Skip to content

Add admin break-glass bypass to RBAC authorization#2232

Draft
philipfweiss wants to merge 1 commit into
DataJunction:mainfrom
philipfweiss:rbac-admin-bypass
Draft

Add admin break-glass bypass to RBAC authorization#2232
philipfweiss wants to merge 1 commit into
DataJunction:mainfrom
philipfweiss:rbac-admin-bypass

Conversation

@philipfweiss

@philipfweiss philipfweiss commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Tracking: #2234 (step 2 of the RBAC enablement sequence).

The RBAC proposal's first resolution step is "if the user is an admin, allow immediately." That short-circuit didn't exist: is_admin was on the user model but never consulted in the authorization path, so there was no break-glass and a deny-by-default flip would lock out admins too.

This adds it:

  • Threads is_admin into AuthContext (from user.is_admin).
  • RBACAuthorizationService.authorize short-circuits for admins, approving all requests with reason="admin".
  • The bypass is a single explicit check and is logged for audit (username, id, and the requests granted), which also pre-pays for the audit-logging work later.

Kept deliberately in one place so it's easy to later scope down to "admin bypasses grants but still respects X" if needed. No-op for non-admins; default seeded users are non-admin.

Thread is_admin into AuthContext and short-circuit RBAC authorization for
admins, approving all requests. The bypass is a single explicit check and
is logged for audit, so it is easy to find and to later scope down if
admins should still respect some constraints.

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify

netlify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 2d07934
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a235a2bcfa3dd00085dc791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant