Commit 1b82b64
feat(auth): expose isPlatformAdmin on the customSession user (#1859)
* feat(auth): expose isPlatformAdmin on the customSession user
The session payload already derives an `admin` role when the user is a
platform admin or active-org admin, but it never surfaces the underlying
platform-admin boolean. Console action `visible` CEL predicates need to
distinguish platform-admin-only actions (e.g. sys_environment.change_plan)
from org-admin actions, which a coarse `admin` role cannot do.
Capture the platform-admin check once and attach `isPlatformAdmin` to both
customSession return paths. Org-admins who are not platform admins get
`isPlatformAdmin: false` (correct — those actions are platform-admin-only).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(changeset): plugin-auth isPlatformAdmin session field
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f3d1069 commit 1b82b64
2 files changed
Lines changed: 16 additions & 3 deletions
File tree
- .changeset
- packages/plugins/plugin-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
1024 | | - | |
| 1024 | + | |
| 1025 | + | |
1025 | 1026 | | |
1026 | 1027 | | |
1027 | 1028 | | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
1031 | | - | |
1032 | | - | |
| 1032 | + | |
| 1033 | + | |
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
| |||
0 commit comments