Skip to content

feat(rbac): support inherited permission overrides - #68

Open
viganogabriele wants to merge 2 commits into
mainfrom
feat/role-permission-inheritance
Open

viganogabriele wants to merge 2 commits into
mainfrom
feat/role-permission-inheritance

Conversation

@viganogabriele

@viganogabriele viganogabriele commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Inherited permissions now appear checked in the role editor. Each permission shows its source: Inherited (with parent names), Direct, or Implied. Unchecking an inherited permission creates an amber Override; Use inherited restores the parent behavior. Direct permissions can still be added and removed normally.

Overrides persist as explicit exclusions on role_permission and apply after inheritance and permission implications. They propagate to descendants without changing parents or siblings; independently held roles still combine their grants. Delegation checks use directly held roles to preserve override boundaries and prevent privilege escalation. Essential read access required by managed write/assign permissions remains enforced.

Includes migration 0022, which defaults existing assignments to granted, plus resolution, draft interaction, persistence, audit, and delegation regression coverage.

Role member counts, member lists and assignment search now follow role inheritance as well. A person assigned Trusted Admin also counts under Admin, once even when multiple inheritance paths or a direct assignment overlap. Inherited members show their source roles; removing a direct assignment preserves membership still inherited from another role. Counts follow manually assigned roles, while managed memberships remain determined by identity evidence.

Validation: vp check; full suite with disposable PostgreSQL (372 passed, 66 skipped — remaining opt-in integrations were not configured); vp run build, including server bundle checks. Browser verified inherited preselection, direct/inherited labels, exclusion and save/reload, inheritance reset, and direct grant removal/reassignment.

Browser also verified that a Trusted Admin member appears in the Admin list and both role counts. PostgreSQL regressions cover transitive/diamond inheritance, deduplication, cycle termination and counts after assignment/parent changes.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12084fdd-d215-4ab0-9c21-aa99785858f6
📥 Commits

Reviewing files that changed from the base of the PR and between 2721e98 and b9ba3b6.

📒 Files selected for processing: 16
  • README.md
  • drizzle/0022_role_permission_overrides.sql
  • drizzle/meta/0022_snapshot.json
  • drizzle/meta/_journal.json
  • package.json
  • src/auth/rbac-delegation.ts
  • src/auth/rbac-security.integration.test.mjs
  • src/auth/rbac-store.ts
  • src/auth/rbac.functions.ts
  • src/auth/rbac.test.ts
  • src/auth/rbac.ts
  • src/components/rbac/pick-list.tsx
  • src/components/rbac/role-form.tsx
  • src/components/rbac/role-members.tsx
  • src/db/rbac.ts
  • src/routes/access/roles/$roleId.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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