@medusajs/rbac 2.22.5 → 2.22.7-preview-20261113084204

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 (3) hide show
  1. package/AGENTS.md +1 -0
  2. package/package.json +5 -5
  3. package/CHANGELOG.md +0 -268
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.5",
3
+ "version": "2.22.7-preview-20261113084204",
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.5",
47
- "@medusajs/test-utils": "2.22.5"
46
+ "@medusajs/framework": "2.22.7-preview-20261113084204",
47
+ "@medusajs/test-utils": "2.22.7-preview-20261113084204"
48
48
  },
49
49
  "peerDependencies": {
50
- "@medusajs/framework": "2.22.5"
50
+ "@medusajs/framework": "2.22.7-preview-20261113084204"
51
51
  }
52
- }
52
+ }
package/CHANGELOG.md DELETED
@@ -1,268 +0,0 @@
1
- # @medusajs/rbac
2
-
3
- ## 2.22.5
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [[`7dd3c28`](https://github.com/medusajs/medusa/commit/7dd3c28fba6b74aaab84612b696cab597e12c667)]:
8
- - @medusajs/framework@2.22.5
9
-
10
- ## 2.22.4
11
-
12
- ### Patch Changes
13
-
14
- - Updated dependencies [[`3a0cbbb`](https://github.com/medusajs/medusa/commit/3a0cbbb89ff547928a5a98365a4beab16bd57d6f), [`3d85f84`](https://github.com/medusajs/medusa/commit/3d85f848e2f01422efc1e4a8b37e6441fc3f7cc5)]:
15
- - @medusajs/framework@2.22.4
16
-
17
- ## 2.22.3
18
-
19
- ### Patch Changes
20
-
21
- - [#17618](https://github.com/medusajs/medusa/pull/17618) [`385c4ff`](https://github.com/medusajs/medusa/commit/385c4ff75f4fada544b6384779a0ede21b66c741) Thanks [@shahednasser](https://github.com/shahednasser)! - chore: update jest to v30.5.2 and use the `--testPathPatterns` flag in test scripts
22
-
23
- - [#15620](https://github.com/medusajs/medusa/pull/15620) [`a6a4254`](https://github.com/medusajs/medusa/commit/a6a4254fb804ae671b778df15c1a5977826930b8) Thanks [@NicolasGorga](https://github.com/NicolasGorga)! - feat(dashboard,medusa,core-flows,framework,js-sdk,modules-sdk,types,utils,link-modules,rbac): end to end RBAC implementation
24
-
25
- - Updated dependencies [[`9692b99`](https://github.com/medusajs/medusa/commit/9692b996485e6fc6e7cb7f6d18ab730962b9727e), [`2e0d8ae`](https://github.com/medusajs/medusa/commit/2e0d8ae841c64f6c896886153269fe31a6b5d51d), [`385c4ff`](https://github.com/medusajs/medusa/commit/385c4ff75f4fada544b6384779a0ede21b66c741), [`2276c84`](https://github.com/medusajs/medusa/commit/2276c84d47d0d6dc078a6eea2350b9d097a0231b), [`a6a4254`](https://github.com/medusajs/medusa/commit/a6a4254fb804ae671b778df15c1a5977826930b8)]:
26
- - @medusajs/framework@2.22.3
27
-
28
- ## 2.22.2
29
-
30
- ### Patch Changes
31
-
32
- - Updated dependencies [[`ca881e5`](https://github.com/medusajs/medusa/commit/ca881e5e758c49cfcbac4130d7e626dc06f439a6), [`9d55082`](https://github.com/medusajs/medusa/commit/9d55082bf9706e45b148100808f4d4550b9105bc), [`26e5807`](https://github.com/medusajs/medusa/commit/26e58070c1661c14aedc02ee6cfb0b2bb28d497b), [`52caddd`](https://github.com/medusajs/medusa/commit/52cadddcf34fdbbc70be34aecd036d6885e8fa5d)]:
33
- - @medusajs/framework@2.22.2
34
-
35
- ## 2.22.1
36
-
37
- ### Patch Changes
38
-
39
- - Updated dependencies []:
40
- - @medusajs/framework@2.22.1
41
-
42
- ## 2.22.0
43
-
44
- ### Minor Changes
45
-
46
- - [#17089](https://github.com/medusajs/medusa/pull/17089) [`d249d29ddef76d0bde0b68899b9fe5f9faa1ef6a`](https://github.com/medusajs/medusa/commit/d249d29ddef76d0bde0b68899b9fe5f9faa1ef6a) Thanks [@shahednasser](https://github.com/shahednasser)! - chore: drop Node.js 20 support and require Node.js v22.22.0 or later
47
-
48
- ### Patch Changes
49
-
50
- - [#17382](https://github.com/medusajs/medusa/pull/17382) [`1db74006ede40300afe64970024688a1a9c2a936`](https://github.com/medusajs/medusa/commit/1db74006ede40300afe64970024688a1a9c2a936) Thanks [@shahednasser](https://github.com/shahednasser)! - chore: ship AGENTS.md in published packages and add agent discovery fields to package.json
51
-
52
- - Updated dependencies [[`d249d29ddef76d0bde0b68899b9fe5f9faa1ef6a`](https://github.com/medusajs/medusa/commit/d249d29ddef76d0bde0b68899b9fe5f9faa1ef6a), [`14499a2e9309d653c0e4ec6aec3f88079751b4d2`](https://github.com/medusajs/medusa/commit/14499a2e9309d653c0e4ec6aec3f88079751b4d2), [`44db0ca6357ab4d4681a8004e869fde339c3117a`](https://github.com/medusajs/medusa/commit/44db0ca6357ab4d4681a8004e869fde339c3117a), [`1db74006ede40300afe64970024688a1a9c2a936`](https://github.com/medusajs/medusa/commit/1db74006ede40300afe64970024688a1a9c2a936)]:
53
- - @medusajs/framework@2.22.0
54
-
55
- ## 2.21.2
56
-
57
- ### Patch Changes
58
-
59
- - Updated dependencies []:
60
- - @medusajs/framework@2.21.2
61
-
62
- ## 2.21.1
63
-
64
- ### Patch Changes
65
-
66
- - Updated dependencies [[`c000d377f1a90d14bcda41500b1ed5bc2734902e`](https://github.com/medusajs/medusa/commit/c000d377f1a90d14bcda41500b1ed5bc2734902e)]:
67
- - @medusajs/framework@2.21.1
68
-
69
- ## 2.21.0
70
-
71
- ### Patch Changes
72
-
73
- - Updated dependencies [[`e9d1f84dbfacd35d7787d1af03215a6ae5a176d8`](https://github.com/medusajs/medusa/commit/e9d1f84dbfacd35d7787d1af03215a6ae5a176d8), [`a4c0a845e8b3a7a5acfaacbb0c093cd539ac713b`](https://github.com/medusajs/medusa/commit/a4c0a845e8b3a7a5acfaacbb0c093cd539ac713b), [`c8701e77534f7b615c8b86814f8d5789c0104382`](https://github.com/medusajs/medusa/commit/c8701e77534f7b615c8b86814f8d5789c0104382), [`df8c278d615229436be5b299ebdc76a576695fc3`](https://github.com/medusajs/medusa/commit/df8c278d615229436be5b299ebdc76a576695fc3)]:
74
- - @medusajs/framework@2.21.0
75
-
76
- ## 2.20.1
77
-
78
- ### Patch Changes
79
-
80
- - Updated dependencies [[`f373c17dd60cb1e7df1d0c70db31d516d2a0cb4f`](https://github.com/medusajs/medusa/commit/f373c17dd60cb1e7df1d0c70db31d516d2a0cb4f)]:
81
- - @medusajs/framework@2.20.1
82
-
83
- ## 2.20.0
84
-
85
- ### Patch Changes
86
-
87
- - Updated dependencies [[`847612908fdd1c11a4df09ccc2e8ab44d338bb04`](https://github.com/medusajs/medusa/commit/847612908fdd1c11a4df09ccc2e8ab44d338bb04), [`785fd2b8a978201638a4d8d5ae9eea483958c0fb`](https://github.com/medusajs/medusa/commit/785fd2b8a978201638a4d8d5ae9eea483958c0fb), [`706ce874672c9cd1d8fc0c5429fc0dd24e6910a9`](https://github.com/medusajs/medusa/commit/706ce874672c9cd1d8fc0c5429fc0dd24e6910a9), [`6a2fce501f3bcd459c21a67f586c7a15b905ff0f`](https://github.com/medusajs/medusa/commit/6a2fce501f3bcd459c21a67f586c7a15b905ff0f), [`5e06e544a296b9033f20f71f11c559f81a0e5739`](https://github.com/medusajs/medusa/commit/5e06e544a296b9033f20f71f11c559f81a0e5739)]:
88
- - @medusajs/framework@2.20.0
89
-
90
- ## 2.19.0
91
-
92
- ### Patch Changes
93
-
94
- - Updated dependencies [[`372a1ab8fa4c8415f1eda294e3c4c5d9dbee4a30`](https://github.com/medusajs/medusa/commit/372a1ab8fa4c8415f1eda294e3c4c5d9dbee4a30), [`5f4d93c374b0ad0b0a31e75de98c7557e0415677`](https://github.com/medusajs/medusa/commit/5f4d93c374b0ad0b0a31e75de98c7557e0415677), [`5105fec20908cf7bcd7f5f859674acdd8a38b982`](https://github.com/medusajs/medusa/commit/5105fec20908cf7bcd7f5f859674acdd8a38b982)]:
95
- - @medusajs/framework@2.19.0
96
-
97
- ## 2.18.0
98
-
99
- ### Patch Changes
100
-
101
- - [`ce410177897f2de3f35825096df7870ebf5b2f8f`](undefined) - fix(rbac): add migration that creates the missing `rbac_role_inheritance` table
102
-
103
- The `RbacRoleInheritance` model is registered by the module but no migration created the corresponding `rbac_role_inheritance` table or its foreign keys, so running `medusa db:migrate` left the module in a broken state and subsequent `medusa db:generate rbac` runs would produce migration files inside `node_modules` (and fail to load under Node's native TS stripping).
104
-
105
- - Updated dependencies [[`1621e14330fe64a968510991408ace8fdac84ce9`](https://github.com/medusajs/medusa/commit/1621e14330fe64a968510991408ace8fdac84ce9), [`1359d1bf6237aa058910b805395932cd070d2043`](https://github.com/medusajs/medusa/commit/1359d1bf6237aa058910b805395932cd070d2043), [`3bf2b51b7e140c3a7f45ad9c9a8a6bd4f470ff09`](https://github.com/medusajs/medusa/commit/3bf2b51b7e140c3a7f45ad9c9a8a6bd4f470ff09), [`d76952b5b0e4b287747a7e08f2cb745510143aae`](https://github.com/medusajs/medusa/commit/d76952b5b0e4b287747a7e08f2cb745510143aae), [`d6b2a87da1dbfd065336c80e41cb7c086dc2a340`](https://github.com/medusajs/medusa/commit/d6b2a87da1dbfd065336c80e41cb7c086dc2a340), [`6ef16b6fdc6f04b900583a5f2714a863011ed19a`](https://github.com/medusajs/medusa/commit/6ef16b6fdc6f04b900583a5f2714a863011ed19a), [`70c122753875f3cca03ff49b8a0ea9fe2c5e1165`](https://github.com/medusajs/medusa/commit/70c122753875f3cca03ff49b8a0ea9fe2c5e1165), [`144c47aba88f6e08fb7c99634c9fec8474721b0a`](https://github.com/medusajs/medusa/commit/144c47aba88f6e08fb7c99634c9fec8474721b0a), [`513c01a5a7f587cb52c92677e2379e54bd990361`](https://github.com/medusajs/medusa/commit/513c01a5a7f587cb52c92677e2379e54bd990361)]:
106
- - @medusajs/framework@2.18.0
107
-
108
- ## 2.17.2
109
-
110
- ### Patch Changes
111
-
112
- - [#15683](https://github.com/medusajs/medusa/pull/15683) [`de58ec503bcd82aae3fe576f9a404c36e2525f4c`](https://github.com/medusajs/medusa/commit/de58ec503bcd82aae3fe576f9a404c36e2525f4c) Thanks [@Floofy6](https://github.com/Floofy6)! - chore: add package bugs metadata
113
-
114
- - Updated dependencies [[`de58ec503bcd82aae3fe576f9a404c36e2525f4c`](https://github.com/medusajs/medusa/commit/de58ec503bcd82aae3fe576f9a404c36e2525f4c)]:
115
- - @medusajs/framework@2.17.2
116
-
117
- ## 2.17.1
118
-
119
- ### Patch Changes
120
-
121
- - Updated dependencies [[`975313f62b22055ddaacf7852f33cf7b0f4af5df`](https://github.com/medusajs/medusa/commit/975313f62b22055ddaacf7852f33cf7b0f4af5df)]:
122
- - @medusajs/framework@2.17.1
123
-
124
- ## 2.17.0
125
-
126
- ### Patch Changes
127
-
128
- - Updated dependencies [[`57b8e74d0fea8fb0e9dccd76eb6df06f0380071a`](https://github.com/medusajs/medusa/commit/57b8e74d0fea8fb0e9dccd76eb6df06f0380071a)]:
129
- - @medusajs/framework@2.17.0
130
-
131
- ## 2.16.0
132
-
133
- ### Patch Changes
134
-
135
- - Updated dependencies [[`8a6664d6d445f875f56078fad21fe12a185b9627`](https://github.com/medusajs/medusa/commit/8a6664d6d445f875f56078fad21fe12a185b9627), [`20352f4fa2f31e5b491c8b1b244c407392939fbf`](https://github.com/medusajs/medusa/commit/20352f4fa2f31e5b491c8b1b244c407392939fbf), [`90af038c95c835dee5168ffd19cda5182d81b904`](https://github.com/medusajs/medusa/commit/90af038c95c835dee5168ffd19cda5182d81b904), [`66610b87efb112e37b78c7c9536d95070b8d6b11`](https://github.com/medusajs/medusa/commit/66610b87efb112e37b78c7c9536d95070b8d6b11)]:
136
- - @medusajs/framework@2.16.0
137
-
138
- ## 2.15.5
139
-
140
- ### Patch Changes
141
-
142
- - [#14593](https://github.com/medusajs/medusa/pull/14593) [`538f98da78ae2d741f1182e6ef315ba8efac6911`](https://github.com/medusajs/medusa/commit/538f98da78ae2d741f1182e6ef315ba8efac6911) Thanks [@fPolic](https://github.com/fPolic)! - feat(dashboard,framework,rbac,js-sdk,types,utils,medusa): rbac admin dashboard utils
143
-
144
- - Updated dependencies [[`8122633a8b33164a6094f5a39896e356efde1747`](https://github.com/medusajs/medusa/commit/8122633a8b33164a6094f5a39896e356efde1747), [`538f98da78ae2d741f1182e6ef315ba8efac6911`](https://github.com/medusajs/medusa/commit/538f98da78ae2d741f1182e6ef315ba8efac6911)]:
145
- - @medusajs/framework@2.15.5
146
-
147
- ## 2.15.4
148
-
149
- ### Patch Changes
150
-
151
- - Updated dependencies []:
152
- - @medusajs/framework@2.15.4
153
-
154
- ## 2.15.3
155
-
156
- ### Patch Changes
157
-
158
- - Updated dependencies []:
159
- - @medusajs/framework@2.15.3
160
-
161
- ## 2.15.2
162
-
163
- ### Patch Changes
164
-
165
- - Updated dependencies [[`2b21d15640ae459386b0acea4c83804c6f502b9d`](https://github.com/medusajs/medusa/commit/2b21d15640ae459386b0acea4c83804c6f502b9d)]:
166
- - @medusajs/framework@2.15.2
167
-
168
- ## 2.15.1
169
-
170
- ### Patch Changes
171
-
172
- - Updated dependencies []:
173
- - @medusajs/framework@2.15.1
174
-
175
- ## 2.15.0
176
-
177
- ### Patch Changes
178
-
179
- - Updated dependencies []:
180
- - @medusajs/framework@2.15.0
181
-
182
- ## 2.14.2
183
-
184
- ### Patch Changes
185
-
186
- - Updated dependencies [[`be0b8817a1e2e48e1c6c579de6598c6f5e9bf4b0`](https://github.com/medusajs/medusa/commit/be0b8817a1e2e48e1c6c579de6598c6f5e9bf4b0), [`7c659ff3d69c43bd7477bcc8a1c0afd092ea1c23`](https://github.com/medusajs/medusa/commit/7c659ff3d69c43bd7477bcc8a1c0afd092ea1c23)]:
187
- - @medusajs/framework@2.14.2
188
-
189
- ## 2.14.1
190
-
191
- ### Patch Changes
192
-
193
- - Updated dependencies []:
194
- - @medusajs/framework@2.14.1
195
-
196
- ## 2.14.0
197
-
198
- ### Patch Changes
199
-
200
- - Updated dependencies [[`0929b8d192833e10b6b91795f1ffc478938c3fb7`](https://github.com/medusajs/medusa/commit/0929b8d192833e10b6b91795f1ffc478938c3fb7), [`843dbfe7c8f27b732486c7a8da7b6d63f2fdf967`](https://github.com/medusajs/medusa/commit/843dbfe7c8f27b732486c7a8da7b6d63f2fdf967)]:
201
- - @medusajs/framework@2.14.0
202
-
203
- ## 2.13.6
204
-
205
- ### Patch Changes
206
-
207
- - Updated dependencies [[`2b0cd5ff0ce00bf1de1d99632f1bda4073ac035d`](https://github.com/medusajs/medusa/commit/2b0cd5ff0ce00bf1de1d99632f1bda4073ac035d)]:
208
- - @medusajs/framework@2.13.6
209
-
210
- ## 2.13.5
211
-
212
- ### Patch Changes
213
-
214
- - Updated dependencies []:
215
- - @medusajs/framework@2.13.5
216
-
217
- ## 2.13.4
218
-
219
- ### Patch Changes
220
-
221
- - Updated dependencies []:
222
- - @medusajs/framework@2.13.4
223
-
224
- ## 2.13.3
225
-
226
- ### Patch Changes
227
-
228
- - Updated dependencies [[`dbaae9630d26a0806751d5614beadef3e0b4bf07`](https://github.com/medusajs/medusa/commit/dbaae9630d26a0806751d5614beadef3e0b4bf07)]:
229
- - @medusajs/framework@2.13.3
230
-
231
- ## 2.13.2
232
-
233
- ### Patch Changes
234
-
235
- - Updated dependencies [[`7aca778ae56069371f5d26a757d3b2276d524776`](https://github.com/medusajs/medusa/commit/7aca778ae56069371f5d26a757d3b2276d524776), [`77d899e135ed75668ca7d7b01a8ed4f0c1fe0ac8`](https://github.com/medusajs/medusa/commit/77d899e135ed75668ca7d7b01a8ed4f0c1fe0ac8)]:
236
- - @medusajs/framework@2.13.2
237
-
238
- ## 2.13.1
239
-
240
- ### Patch Changes
241
-
242
- - Updated dependencies []:
243
- - @medusajs/framework@2.13.1
244
-
245
- ## 2.13.0
246
-
247
- ### Minor Changes
248
-
249
- - [`a31e72c31c5235240cead2d04e39e5927688eec7`](https://github.com/medusajs/medusa/commit/a31e72c31c5235240cead2d04e39e5927688eec7) Thanks [@olivermrbl](https://github.com/olivermrbl)! - chore: Minor bump
250
-
251
- ### Patch Changes
252
-
253
- - Updated dependencies [[`a31e72c31c5235240cead2d04e39e5927688eec7`](https://github.com/medusajs/medusa/commit/a31e72c31c5235240cead2d04e39e5927688eec7)]:
254
- - @medusajs/framework@2.13.0
255
-
256
- ## 2.12.6
257
-
258
- ### Patch Changes
259
-
260
- - Updated dependencies [[`13476988763368b3b333fa5bc3f613e8eb174fdf`](https://github.com/medusajs/medusa/commit/13476988763368b3b333fa5bc3f613e8eb174fdf), [`8890f284705a4843a57a3800820208f593689a2a`](https://github.com/medusajs/medusa/commit/8890f284705a4843a57a3800820208f593689a2a), [`1ca3516a5cbb059ad79fe483cd8e1d6a7ebca23b`](https://github.com/medusajs/medusa/commit/1ca3516a5cbb059ad79fe483cd8e1d6a7ebca23b)]:
261
- - @medusajs/framework@2.12.6
262
-
263
- ## 2.12.5
264
-
265
- ### Patch Changes
266
-
267
- - Updated dependencies [[`233ec261be200fac83002415aa7c0df082339a3f`](https://github.com/medusajs/medusa/commit/233ec261be200fac83002415aa7c0df082339a3f)]:
268
- - @medusajs/framework@2.12.5