Commit 305e02c
committed
fix(credentials): grant admin role to credential creator
Revert admin-only restriction — write users can create secrets.
Ensure the acting user (creator) always gets admin role on the
credential via actingUserId parameter in ensureWorkspaceCredentialMemberships
and session.user.id check in route.ts POST.
Role mapping:
- workspace owner → admin
- credential creator (actingUserId/session.user.id) → admin
- workspace admin permission → admin
- write/read → member1 parent 80c7061 commit 305e02c
2 files changed
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
| 299 | + | |
| 300 | + | |
309 | 301 | | |
310 | 302 | | |
311 | 303 | | |
| |||
557 | 549 | | |
558 | 550 | | |
559 | 551 | | |
560 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
561 | 556 | | |
562 | 557 | | |
563 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
176 | | - | |
| 178 | + | |
| 179 | + | |
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
| |||
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
258 | | - | |
| 261 | + | |
| 262 | + | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
| |||
0 commit comments