Skip to content
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

chore: disable API calls for un-authorized users #3144

Merged
merged 3 commits into from
Dec 16, 2023

Conversation

aaryan610
Copy link
Collaborator

@aaryan610 aaryan610 commented Dec 15, 2023

Problem:

  1. If a user doesn't have access to a workspace/project, API calls to fetch workspace/project related data were still being made.

Solution:

  1. Added hasPermissionToWorkspace flag to all the API calls in the workspace wrapper and autorun of workspace stores to check for permission before making the request.
  2. Added hasPermissionToProject flag to all the API calls in the project wrapper and autorun of project stores to check for permission before making the request.

Other improvements:

  1. Removed type declarations for router.query at the declaration level.
  2. Use useSWRImmutable to fetch user's instance admin status, disabling revalidation.

@sriramveeraghanta sriramveeraghanta merged commit 8a1a6c6 into develop Dec 16, 2023
6 of 8 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/api_calls branch December 16, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants