nodebb-plugin-calendar-onekite 12.0.7 → 12.0.8

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 +6 -10
  2. package/package.json +1 -1
package/lib/api.js CHANGED
@@ -149,10 +149,8 @@ async function canValidate(uid, settings) {
149
149
 
150
150
  const allowed = (settings.validatorGroups || '').split(',').map(s => s.trim()).filter(Boolean);
151
151
  if (!allowed.length) return false;
152
- for (const g of allowed) {
153
- const isMember = await groups.isMember(uid, g);
154
- if (isMember) return true;
155
- }
152
+ if (await userInAnyGroup(uid, allowed)) return true;
153
+
156
154
  return false;
157
155
  }
158
156
 
@@ -166,9 +164,8 @@ async function canCreateSpecial(uid, settings) {
166
164
  } catch (e) {}
167
165
  const allowed = (settings.specialCreatorGroups || '').split(',').map(s => s.trim()).filter(Boolean);
168
166
  if (!allowed.length) return false;
169
- for (const g of allowed) {
170
- if (await groups.isMember(uid, g)) return true;
171
- }
167
+ if (await userInAnyGroup(uid, allowed)) return true;
168
+
172
169
  return false;
173
170
  }
174
171
 
@@ -182,9 +179,8 @@ async function canDeleteSpecial(uid, settings) {
182
179
  } catch (e) {}
183
180
  const allowed = (settings.specialDeleterGroups || settings.specialCreatorGroups || '').split(',').map(s => s.trim()).filter(Boolean);
184
181
  if (!allowed.length) return false;
185
- for (const g of allowed) {
186
- if (await groups.isMember(uid, g)) return true;
187
- }
182
+ if (await userInAnyGroup(uid, allowed)) return true;
183
+
188
184
  return false;
189
185
  }
190
186
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-calendar-onekite",
3
- "version": "12.0.7",
3
+ "version": "12.0.8",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",