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

Added respective responses discerning between unauthorized (not logged-in) and forbidden responses. #10334

Conversation

Spaarsh
Copy link
Contributor

@Spaarsh Spaarsh commented Jan 14, 2025

Closes #10224

fix

Technical

It simply changes the response returned for a authenticated user without the necessary clearance (admin, librarian or super-librarian) to see the /merge/works and adds a condition for responding to a request sent by unauthenticated users.

Testing

The PR affects two cases:

  1. Attempt to access the http://localhost:8080/works/merge?records=OL15941796W,OL15400921W by logging into a user type that is not a super-librarian, librarian or admin. If a forbidden response is received, the PR works as expected.
  2. Attempt to access the http://localhost:8080/works/merge?records=OL15941796W,OL15400921W without logging-in. If an "unauthorized" response is received, the PR works as expected.

Screenshot

Case 1 - Logged-in but not admin, librarian or super-librarian:
image

Case 2 - Not logged-in
image

Stakeholders

@jimchamp

Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

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

Thanks @Spaarsh! This works as expected.

@jimchamp jimchamp merged commit 042b544 into internetarchive:master Jan 14, 2025
4 checks passed
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.

Incorrect response returned for unauthenticated /works/merge GET requests
2 participants