Skip to content

Replace alphaRbac feature flag with backend-driven RBAC config#7877

Merged
thabofletcher merged 6 commits intomainfrom
fix/rbac-config-unification
Apr 14, 2026
Merged

Replace alphaRbac feature flag with backend-driven RBAC config#7877
thabofletcher merged 6 commits intomainfrom
fix/rbac-config-unification

Conversation

@thabofletcher
Copy link
Copy Markdown
Contributor

Summary

  • Removes the static alphaRbac frontend feature flag that caused a split-brain with the backend RBAC config
  • Frontend RBAC behavior is now driven by rbac.enabled from the Plus health endpoint (/api/v1/plus/health)
  • One flag (FIDESPLUS__RBAC__ENABLED) controls both frontend and backend RBAC mode
  • Fixes regression where the RolesForm showed empty roles for users assigned via the legacy permission system when the frontend flag was on but backend RBAC was off

Companion PR

  • ethyca/fidesplus - fix/rbac-config-unification (exposes rbac.enabled in Plus health endpoint)

Test plan

  • With FIDESPLUS__RBAC__ENABLED=false (default): verify legacy Permissions tab is shown, owner user can see all pages, permissions work correctly
  • With FIDESPLUS__RBAC__ENABLED=true: verify RBAC Roles tab is shown, role assignments reflect correctly
  • Verify no remaining references to alphaRbac in the codebase
  • Verify Cypress E2E tests pass with updated fixtures

The frontend RBAC behavior was controlled by a static alphaRbac feature
flag that defaulted to true in development, while the backend RBAC was
off by default. This split-brain caused the RolesForm to show empty
roles for users assigned via the legacy system, and potentially
prevented page access due to a race condition in permission resolution.

Replace the static flag with a backend-driven check: the Plus health
endpoint now exposes rbac.enabled, and the frontend reads this to
determine RBAC mode. One flag (FIDESPLUS__RBAC__ENABLED) now controls
both frontend and backend behavior.
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Apr 13, 2026 7:23pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Apr 13, 2026 7:23pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 7%
5.89% (2564/43460) 4.95% (1219/24623) 3.97% (512/12865)
fides-js Coverage: 78%
78.98% (1962/2484) 65.55% (1214/1852) 72.57% (336/463)
privacy-center Coverage: 88%
85.93% (330/384) 81.1% (176/217) 78.87% (56/71)

@thabofletcher thabofletcher marked this pull request as ready for review April 13, 2026 16:59
@thabofletcher thabofletcher requested a review from a team as a code owner April 13, 2026 16:59
@thabofletcher thabofletcher requested review from jpople and removed request for a team April 13, 2026 16:59
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: Replace alphaRbac flag with backend-driven RBAC config

This is a clean, focused migration. The approach — reading rbac.enabled from the Plus health endpoint instead of a client-side feature flag — is the right call: it makes RBAC gating a server-side concern and removes a flag that developers would have to remember to toggle. The implementation is consistent across the affected files.

Summary of findings

Must fix (1)

  • HealthCheck.ts: rbac is typed as required (rbac: RBACStatus) but every call site in this PR accesses it with optional chaining (?.rbac?.enabled). If an older Plus server omits the field, TypeScript won't catch the mismatch. Declare it rbac?: RBACStatus to match usage. (See inline comment.)

Nits / suggestions (2)

  • features.slice.ts: Minor style inconsistency — rbac uses optional chaining while adjacent tcf uses direct access inside the same ternary guard. Optional chaining is the right approach given the type should be optional; just worth aligning tcf and fides_cloud for consistency.

  • viewer-assigned-system.cy.ts: The inline HealthCheck stub object is a duplicate of PLUS_HEALTH_RBAC_ENABLED from rbac-ui-management.cy.ts. Consider lifting it to a shared Cypress support/fixtures file to prevent drift.

What looks good

  • The plus_health.json fixture now correctly defaults rbac.enabled to false — tests that don't opt in to RBAC will behave correctly without extra setup.
  • CommonSubscriptions.tsx simplification is correct: useFeatures().rbac is already implicitly gated on Plus being available, so the old !isPlusEnabled guard was redundant.
  • selectRbacEnabled in plus.slice.ts is a clean, reusable selector that properly encapsulates the Plus health derivation.
  • Nav config requiresRbac is threaded consistently through configureNavRouteconfigureNavGroupsuseNav.
  • The alphaRbac removal from flags.json is complete with no apparent stale references left.

🔬 Codegraph: connected (46363 nodes)


💡 Write /code-review in a comment to re-run this review.

Comment thread clients/admin-ui/src/types/api/models/HealthCheck.ts
Comment thread clients/admin-ui/src/features/common/features/features.slice.ts
Match the canonical format used by sibling status types (TCFStatus,
FidesCloudStatus). The generated schema correctly marks enabled as
optional since the backend Pydantic field has a default value.
@thabofletcher thabofletcher added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit 8b702f4 Apr 14, 2026
50 of 51 checks passed
@thabofletcher thabofletcher deleted the fix/rbac-config-unification branch April 14, 2026 18:32
@claude claude bot mentioned this pull request Apr 17, 2026
18 tasks
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.

2 participants