You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(platform-objects): retire the set_user_role action from sys_user (#11530)
set_user_role's only effect was internalAdapter.updateUser(userId, { role })
- a gated, UI-driven writer for the legacy sys_user.role scalar ADR-0068 D2
stopped synthesizing. Platform-admin membership is granted through
sys_user_permission_set / admin_full_access; a working "Set Platform Role"
button was a supported, one-user-at-a-time channel for resurrecting the dual
identity representation the 2026-08-18 ruling permanently vetoed (Option 3).
Removal, not a narrowed re-implementation (maintainer ruling, 2026-08-20,
reaffirmed 2026-08-22, Option B). The vendor's POST /admin/set-role route
itself stays mounted and vendor-gated, unchanged - only the sys_user console
action pointing at it is gone.
packages/spec/src/kernel/public-auth-features.ts drops the corresponding
'sys_user.actions.set_user_role' entry from PUBLIC_AUTH_FEATURES.admin's
gatedInputs - the bidirectional feature-gate-guard completeness check in
platform-objects reads this registry and forces the edit.
Pinned in one test with its counter-direction so a retirement that removed
the wrong entry (or several) cannot pass: the retired name is asserted gone
BY NAME, and all 15 sibling sys_user actions are asserted present BY NAME.
Translations regenerated via `node scripts/check-i18n-bundles.mjs --write`
(never hand-edited).
#9968 half 1. Half 2 (impersonate_user) is already fixed and merged on main
via PR #10352 - no changes needed here; see the PR body for the measurement.
Claude-Session: https://claude.ai/code/session_01APWX2AwT3a4xDcjPCe8bk4
Co-authored-by: Claude <noreply@anthropic.com>
**Fix:**`sys_user`'s **`set_user_role`** action ("Set Platform Role") is retired — removed from the object's declared actions, not re-implemented (#9968).
7
+
8
+
The action's only effect was `POST /api/v1/auth/admin/set-role`, which better-auth's `admin` plugin lowers to `internalAdapter.updateUser(userId, { role })` — a gated, UI-driven writer for the legacy `sys_user.role` scalar that ADR-0068 D2 stopped synthesizing. Platform-admin membership is granted through `sys_user_permission_set` / `admin_full_access`; a working "Set Platform Role" button was a supported, one-user-at-a-time channel for resurrecting the dual identity representation the 2026-08-18 ruling permanently vetoed (Option 3).
9
+
10
+
**What an operator will now observe.** The "Set Platform Role" button is gone from the Users list row menu and the user detail header. It was already dead for every platform admin before this change — better-auth's vendor `adminMiddleware` gates on the same retired scalar, so the button 403'd with `YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE` for platform admins and plain members alike. Removing it removes a byte-identical-refusal dead affordance, not a working capability.
11
+
12
+
**Unchanged.** The vendor's `POST /api/v1/auth/admin/set-role` route itself stays mounted and vendor-gated exactly as before — this change touches only the `sys_user` console action pointing at it. Every other `sys_user` admin action (`ban_user`, `unban_user`, `unlock_user`, `create_user`, `set_user_password`, `impersonate_user`) is unaffected.
13
+
14
+
`@objectstack/spec`'s `PUBLIC_AUTH_FEATURES.admin.gatedInputs` registry drops the corresponding `sys_user.actions.set_user_role` entry in the same change (`packages/spec/src/kernel/public-auth-features.ts`) — internal completeness-guard bookkeeping only, no public export shape change.
0 commit comments