Skip to content

Add configurable default-access role to RBAC#2233

Draft
philipfweiss wants to merge 2 commits into
DataJunction:mainfrom
philipfweiss:rbac-default-access-role
Draft

Add configurable default-access role to RBAC#2233
philipfweiss wants to merge 2 commits into
DataJunction:mainfrom
philipfweiss:rbac-default-access-role

Conversation

@philipfweiss

@philipfweiss philipfweiss commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

Stacked on #2232 (step 2, admin bypass). Until that merges, this PR's diff includes its commit; review/merge #2232 first, then rebase.

Adds a DEFAULT_ACCESS_ROLE setting whose scopes are evaluated as a fallback when no explicit grant matches. This lets a deployment express graceful defaults (e.g. "everyone gets read on *") without flipping the entire policy to permissive. This is the configurable-default-access piece of the RBAC proposal.

  • New default_access_role config (default None).
  • The default role's scopes are pre-loaded into AuthContext (keeps authorization DB-free).
  • _make_decision now collects all candidate scopes (explicit grants + default role) and resolves them in one step, then falls back to default_access_policy. Gathering candidates before deciding (instead of a nested allow-ladder) leaves room for future deny/precedence rules without restructuring.

No behavior change by default (default_access_role=None, default_access_policy=permissive).

Philip Weiss and others added 2 commits June 5, 2026 16:22
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>
Add a DEFAULT_ACCESS_ROLE setting whose scopes are evaluated as a fallback
when no explicit grant matches, so deployments can express graceful
defaults (e.g. read on *) without flipping the whole policy to permissive.

The default role's scopes are pre-loaded into AuthContext and evaluated
together with the principal's own scopes: _make_decision now gathers all
candidate scopes (explicit grants + default role) and resolves them in one
step, then falls back to default_access_policy. Collecting candidates
before deciding (rather than a nested allow-ladder) keeps the door open for
future deny/precedence rules.

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 6da138a
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a235b8cccde9d00099f2dab

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