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(rbac,webapp): isUsingPlugin() on the controller — drop sentinel-string coupling
The PAT-creation flow needed to know "is a real RBAC plugin loaded, or
just the OSS fallback?" so it could skip the compensating-delete
rollback path when the fallback returns ok:false from setTokenRole
(no plugin → no role table to write to → that's not a failure).
Previous implementation stringly-typed it: the fallback returned
`{ ok: false, error: "RBAC plugin not installed" }`, and the webapp's
PAT module compared `roleResult.error === FALLBACK_NOT_INSTALLED_ERROR`
to detect the case. If the fallback's error string ever drifted, PAT
creation would blow up with a compensating-delete on every install
without an enterprise plugin.
Replace with an explicit capability method on the controller:
RoleBaseAccessController.isUsingPlugin(): Promise<boolean>
OSS fallback returns false; cloud plugin returns true. LazyController
delegates. The webapp gates the rbac.setTokenRole call on
`await rbac.isUsingPlugin()`, skipping it when the fallback is in
use. No string magic, decoupled from any specific error message,
and the capability is generally useful — UI surfaces that gate
role-pickers / admin-only sections on plugin presence can use the
same method.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments