fix(react, core): Add a new opt-out prop to Auth0ComponentProvider for skip permission gating - #550
Merged
grandmaester merged 2 commits intoSep 29, 2026
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
skipGating opt-out prop to Auth0ComponentProvider for permission gating
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #550 +/- ##
========================================
Coverage 91.20% 91.21%
========================================
Files 258 258
Lines 19870 19886 +16
Branches 3060 2406 -654
========================================
+ Hits 18123 18139 +16
Misses 1747 1747 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Ajeey
reviewed
Sep 29, 2026
Ajeey
approved these changes
Sep 29, 2026
grandmaester
deleted the
fix/opt-out-flow-added-for-permissions-gating
branch
September 29, 2026 13:16
7 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
disablePermissionEnforcementopt-out prop toAuth0ComponentProviderthat allows consumers to bypass permission gating entirely when theauth/profileAPI is not available/setup in their environment.Why
Some teams consuming these components have not set up the
auth/profileAPI (used to resolve user permission scopes). Without an opt-out,PermissionProviderfalls back to an empty permissions array after a failed fetch, causing all gated actions to be disabled — making the components effectively unusable for those teams.What
packages/core—permission-map.ts: AddsdisablePermissionEnforcement?: booleantoPermissionOptions;evaluateRulereturnstrueimmediately when set, taking precedence overreadOnlypackages/react—permission-provider.tsx: AcceptsdisablePermissionEnforcementprop; short-circuits thefetchPermissionseffect (nogetPermissions()call, no network request)packages/react—use-permissions.ts: ForwardsdisablePermissionEnforcementfrom context into everycreatePermissionResolvercall so all permission flags resolve totruepackages/react—spa-provider.tsx/proxy-provider.tsx: Destructure and forwarddisablePermissionEnforcementfromAuth0ComponentProviderPropstoPermissionProviderpackages/react—auth-types.ts/permissions-types.ts: Type definitions updated across the chainPackages
packages/corepackages/reactexamplesReferences
Permission gating feature introduced in PRs #484–#486, #494.
Testing
When Readonly Permissions are only provided but disablePermissionEnforcement is true(opt-out):
GMT20260929-092319_Clip_Rohit.Sharma.s.Clip.09_29_2026.mp4
When Readonly Permissions are only provided but disablePermissionEnforcement is null or not set(existing behavior):
GMT20260929-092531_Clip_Rohit.Sharma.s.Clip.09_29_2026.mp4
Same flow has been tested for SPA mode as well.
Note: Even though on Client, disablePermissionEnforcement making things editable and actionable, backend also enforeces scope checks which will most operations if required scopes are not set.
permission-map.test.ts: two new cases —disablePermissionEnforcementgrants all flags, takes precedence overreadOnlypermission-provider.test.tsx: new case — fetch is skipped, all permission flags resolve totrueend-to-endChecklist
Contributing