@primitive.ai/prim 0.1.0-alpha.25 → 0.1.0-alpha.26
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/index.js +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -472,13 +472,16 @@ function applyStatusLine(settings) {
|
|
|
472
472
|
function applyPermissions(settings) {
|
|
473
473
|
const permissions = settings.permissions ?? {};
|
|
474
474
|
const allow = permissions.allow ?? [];
|
|
475
|
-
const
|
|
476
|
-
const
|
|
477
|
-
|
|
478
|
-
if (unchanged) {
|
|
475
|
+
const hasCanonical = allow.includes(PRIM_PERMISSION_RULE);
|
|
476
|
+
const hasLegacy = allow.some((rule) => LEGACY_PRIM_PERMISSION_RULES.includes(rule));
|
|
477
|
+
if (hasCanonical && !hasLegacy) {
|
|
479
478
|
return settings;
|
|
480
479
|
}
|
|
481
|
-
|
|
480
|
+
const withoutPrim = allow.filter((rule) => !ALL_PRIM_PERMISSION_RULES.has(rule));
|
|
481
|
+
return {
|
|
482
|
+
...settings,
|
|
483
|
+
permissions: { ...permissions, allow: [...withoutPrim, PRIM_PERMISSION_RULE] }
|
|
484
|
+
};
|
|
482
485
|
}
|
|
483
486
|
function removePrimPermission(settings) {
|
|
484
487
|
const permissions = settings.permissions;
|
package/package.json
CHANGED