@koloseum/utils 0.3.4 → 0.3.5
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.
- package/dist/client.js +9 -23
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -402,29 +402,15 @@ export const Access = {
|
|
|
402
402
|
const roleHasFeature = (r) => isRootFeature ||
|
|
403
403
|
("root" in r && r.root === true) ||
|
|
404
404
|
("featureSlugs" in r && feature.slug !== undefined && (r.featureSlugs?.includes(feature.slug) ?? false));
|
|
405
|
-
// Check through
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
return true;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
// Check through Backroom microservices
|
|
418
|
-
if (type === "backroom") {
|
|
419
|
-
const microservices = Config.microservices.backroom;
|
|
420
|
-
for (const ms of microservices) {
|
|
421
|
-
if (!ms.roles)
|
|
422
|
-
continue;
|
|
423
|
-
const featureInMs = ms.features.some(featureMatches);
|
|
424
|
-
const msRole = ms.roles.find((r) => r.slug === role.slug);
|
|
425
|
-
if (featureInMs && msRole && roleHasFeature(msRole))
|
|
426
|
-
return true;
|
|
427
|
-
}
|
|
405
|
+
// Check through microservices for the given type
|
|
406
|
+
const microservices = type === "lounges" ? Config.microservices.lounges : Config.microservices.backroom;
|
|
407
|
+
for (const ms of microservices) {
|
|
408
|
+
if (!ms.roles)
|
|
409
|
+
continue;
|
|
410
|
+
const featureInMs = ms.features.some(featureMatches);
|
|
411
|
+
const msRole = ms.roles.find((r) => r.slug === role.slug);
|
|
412
|
+
if (featureInMs && msRole && roleHasFeature(msRole))
|
|
413
|
+
return true;
|
|
428
414
|
}
|
|
429
415
|
// Return false
|
|
430
416
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koloseum/utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"author": "Koloseum Technologies Limited",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Utility logic for use across Koloseum web apps (TypeScript)",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"validator": "^13.15.15"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@koloseum/types": "^0.3.
|
|
65
|
+
"@koloseum/types": "^0.3.4",
|
|
66
66
|
"@playwright/test": "^1.55.0",
|
|
67
67
|
"@suprsend/web-components": "^0.4.0",
|
|
68
68
|
"@types/sanitize-html": "^2.16.0",
|