[RBAC] Deny access to user with no permissions #2946#4560
Open
Yaksha-sn wants to merge 1 commit intoprovectus:masterfrom
Open
[RBAC] Deny access to user with no permissions #2946#4560Yaksha-sn wants to merge 1 commit intoprovectus:masterfrom
Yaksha-sn wants to merge 1 commit intoprovectus:masterfrom
Conversation
When RBAC is enabled and a user has no permissions assigned, they are now redirected to the 403 Access Denied page instead of seeing a blank dashboard. Fixes provectus#2946
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.
When RBAC is enabled and a user has no permissions assigned,
they are now redirected to the 403 Access Denied page instead
of seeing a blank dashboard.
Fixes #2946
What changes did you make?
Added a
hasNoPermissionscomputed value inPageContainer.tsxthat checks if RBAC is enabled and the authenticated user has zero
permissions. If true, the user is redirected to the existing
/403Access Denied page instead of seeing a blank dashboard.
Is there anything you'd like reviewers to focus on?
Whether the redirect logic placement in PageContainer is appropriate,
and if the existing 403 page message "Access is Denied" is sufficient
or should be more specific like "No permissions assigned to your
account. Contact your administrator."
How Has This Been Tested?
Mocked
useGetUserInfoto returnrbacEnabled: truewith an emptypermissions array and confirmed redirect to
/403page. Revertedmock and confirmed normal flow is unaffected.
Checklist