@medusajs/rbac 2.22.6 → 2.22.7-preview-20261113085903

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/AGENTS.md +1 -0
  2. package/package.json +4 -4
package/AGENTS.md CHANGED
@@ -81,5 +81,6 @@ yarn migration:create # after any change in src/models
81
81
  - A policy's `key`, `resource` and `operation` cannot be changed through `POST /rbac/policies/:id` (only `name`, `description` and `metadata` can). Every role holding the policy would silently gain the new permission, so an actor with `rbac_policy:update` could widen a policy they hold into `*:*`. Create a new policy, or change them from a migration script you control.
82
82
  - The super admin role and policy can't be deleted (`deleteRbacRolesStep` / `deleteRbacPoliciesStep` in `@medusajs/core-flows` throw `NOT_ALLOWED`), and the last user holding the unscoped super admin role can't be unassigned from it or deleted (`ensureSuperAdminRemainsStep`). Calling the module service directly bypasses these checks.
83
83
  - `deleteRbacPoliciesStep` refuses (`NOT_ALLOWED`, naming the roles) to delete a policy any role still holds, and soft deletes the rest: detached `rbac_role_policy` rows keep referencing the policy, so a hard delete violates their foreign key.
84
+ - The admin dashboard hardcodes a map of core policy resources to permission groups and a copy of `RBAC_SUPER_ADMIN_ROLE_ID` (`packages/admin/dashboard/src/routes/roles/common/constants.ts`). Adding a core resource, or changing the super admin role ID, needs the matching change there; a dashboard test fails for an unmapped core resource, nothing catches a changed role ID.
84
85
  - Deleting a core policy only lasts until the next boot: `core-policies.ts` restores it.
85
86
  - The framework caches the resolved permissions of each set of roles an actor holds (`packages/core/framework/src/policies/has-permission.ts`) through the caching module, tagged with `RBAC_CACHE_TAGS` from `@medusajs/framework/utils`. The caching module invalidates those tags from this module's CRUD events, so writes that skip `MedusaService` (raw SQL, events not emitted) leave stale permissions until the entries expire.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/rbac",
3
- "version": "2.22.6",
3
+ "version": "2.22.7-preview-20261113085903",
4
4
  "description": "Medusa RBAC module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,10 +43,10 @@
43
43
  "orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm cache:clear"
44
44
  },
45
45
  "devDependencies": {
46
- "@medusajs/framework": "2.22.6",
47
- "@medusajs/test-utils": "2.22.6"
46
+ "@medusajs/framework": "2.22.7-preview-20261113085903",
47
+ "@medusajs/test-utils": "2.22.7-preview-20261113085903"
48
48
  },
49
49
  "peerDependencies": {
50
- "@medusajs/framework": "2.22.6"
50
+ "@medusajs/framework": "2.22.7-preview-20261113085903"
51
51
  }
52
52
  }