Skip to content

Enforce MANAGE permission on RBAC and group admin APIs#2230

Draft
philipfweiss wants to merge 1 commit into
DataJunction:mainfrom
philipfweiss:rbac-manage-enforcement
Draft

Enforce MANAGE permission on RBAC and group admin APIs#2230
philipfweiss wants to merge 1 commit into
DataJunction:mainfrom
philipfweiss:rbac-manage-enforcement

Conversation

@philipfweiss

@philipfweiss philipfweiss commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

The RBAC engine already exists, but every role/group admin endpoint was auth-only, so any logged-in user could self-grant any role. That makes restrictive access policies unenforceable.

This PR enforces the MANAGE action on those endpoints:

  • Roles (api/rbac.py): create/update/delete, add/remove scope, assign/revoke now require MANAGE on the resources the scope targets. You can only grant access you already manage (prevents privilege escalation).
  • Groups (api/groups.py): register and membership changes require a global MANAGE grant.
  • Adds AccessChecker.add_scope() helper.

No-op under the default permissive policy, so nothing breaks today.

Require a matching MANAGE grant to create, modify, hand out, or revoke
roles and to administer groups, so principals can only delegate access
they already control. Without this, any authenticated user could
self-grant arbitrary roles, making restrictive access policies
unenforceable.

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

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