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
RBAC plugin: Result types on mutation methods + OSS fallback (TRI-8747)
Mutation methods on RoleBaseAccessController now return discriminated
Result unions instead of throwing on expected error paths:
- RoleMutationResult — { ok: true; role: Role } | { ok: false; error }
for createRole, updateRole.
- RoleAssignmentResult — { ok: true } | { ok: false; error: string }
for deleteRole, setUserRole, removeUserRole, setTokenRole,
removeTokenRole.
The cloud webapp surfaces the 'error' strings directly to users
(system role edits, plan-tier gating, validation conflicts), so a
thrown exception now signals only an unexpected failure (DB outage,
bug). Read methods (getUserRole, getTokenRole, allRoles,
allPermissions) are unchanged.
OSS fallback returns { ok: false, error: 'RBAC plugin not installed' }
for every mutation — matches the prior behaviour (createRole/updateRole
already threw with this message; the others were silent no-ops, which
made misuse hard to detect). The LazyController in @internal/rbac
forwards the new return types verbatim. Changeset: patch.
Customer-facing surface: only public type widening of mutation method
return types — no runtime behaviour change for OSS callers (they get
a Result error instead of a thrown error or silent no-op; both indicate
'do not call these without the enterprise plugin').
0 commit comments