nodebb-plugin-calendar-onekite 12.0.6 → 12.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/api.js +8 -0
  2. package/package.json +1 -1
package/lib/api.js CHANGED
@@ -9,6 +9,14 @@ const user = require.main.require('./src/user');
9
9
  const groups = require.main.require('./src/groups');
10
10
 
11
11
  const dbLayer = require('./db');
12
+
13
+ async function userInAnyGroup(uid, allowed) {
14
+ if (!uid || !allowed || !allowed.length) return false;
15
+ const ug = await groups.getUserGroups([uid]);
16
+ const slugs = ug[0] || [];
17
+ return allowed.some(g => slugs.includes(g));
18
+ }
19
+
12
20
  const helloasso = require('./helloasso');
13
21
 
14
22
  // Email helper: NodeBB's Emailer signature differs across versions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-calendar-onekite",
3
- "version": "12.0.6",
3
+ "version": "12.0.7",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",