@medusajs/rbac 2.22.3-snapshot-20261103230838 → 2.22.3

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
@@ -80,5 +80,6 @@ yarn migration:create # after any change in src/models
80
80
 
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
+ - `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.
83
84
  - Deleting a core policy only lasts until the next boot: `core-policies.ts` restores it.
84
85
  - 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.3-snapshot-20261103230838",
3
+ "version": "2.22.3",
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.3-snapshot-20261103230838",
47
- "@medusajs/test-utils": "2.22.3-snapshot-20261103230838"
46
+ "@medusajs/framework": "2.22.3",
47
+ "@medusajs/test-utils": "2.22.3"
48
48
  },
49
49
  "peerDependencies": {
50
- "@medusajs/framework": "2.22.3-snapshot-20261103230838"
50
+ "@medusajs/framework": "2.22.3"
51
51
  }
52
52
  }