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

fix: do not make pins request if the user does not have access #2117 #2122

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexandrastoica
Copy link
Contributor

@alexandrastoica alexandrastoica commented Nov 24, 2022

Do not try to fetch pin requests if the user does not have access.

@alexandrastoica alexandrastoica requested a review from a team as a code owner November 24, 2022 11:01
@github-actions
Copy link
Contributor

Copy link
Contributor

@adamalton adamalton left a comment

Choose a reason for hiding this comment

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

LGTM

@alanshaw
Copy link
Member

The server should be verifying this. Is this not the case already?

The user should not reach this view if they don't have access - they won't see the tabs and the table will not be loaded.

@alexandrastoica alexandrastoica marked this pull request as draft December 5, 2022 13:47
@alexandrastoica
Copy link
Contributor Author

@alanshaw thanks for the review, some context:

The server should be verifying this. Is this not the case already?

Yes it is.

The user should not reach this view if they don't have access - they won't see the tabs and the table will not be loaded.

The user does reach the view, more specifically the PinRequestsTable in FileManager is displayed if pin requests count > 0. To get the count, the FileManager uses the usePinRequests hook which tries to fetch the pin requests and throws an error (which is not handled) if the user does not have access. This leads to an error in the console log in prod which I was trying to avoid for the meantime with this PR, while I was working on #1947.

I marked this as draft and I'm doing some better improvements here #2147, let me know if there's anything that doesn't make sense, or any suggestions :)

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.

Improve the handling of the PSA authorisation error in the FE
3 participants