Skip to content

fix(UI): redirect if user is not permissioned to see workspace #6786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 27, 2023

Conversation

Kira-Pilot
Copy link
Member

resolves #4704

We've added a new hook, useReadPagePermissions to determine if a user has permissions to view a certain page. This hook can be used in tandem with our existing RequirePermission component such that a user without permissions is redirected to /workspaces.

Note: we did have a pre-existing hook, usePermissions that loads all the permissions we query for in our authMachine; however, I added this secondary hook for more fine-grained control. It is nice to have individual pages load their own permissions, and certain resources are permissioned by ID.

For now, I've added redirects to the /workspace page and to the /audit page. If you notice other places in the app that need them, let me know!

Kapture 2023-03-24 at 14 44 02

@Kira-Pilot Kira-Pilot merged commit fc21e15 into main Mar 27, 2023
@Kira-Pilot Kira-Pilot deleted the redirect-to-workspaces/kira-pilot branch March 27, 2023 13:25
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource not found or you do not have access to this resource
2 participants