Content-Length: 216928 | pFad | https://github.com/internetarchive/openlibrary/commit/042b544

CD Merge pull request #10334 from Spaarsh/10224/fix/incorrect-response-f… · internetarchive/openlibrary@042b544 · GitHub
Skip to content

Commit

Permalink
Merge pull request #10334 from Spaarsh/10224/fix/incorrect-response-f…
Browse files Browse the repository at this point in the history
…or-unauthenticated-get-works-merge-request

Added respective responses discerning between unauthorized (not logged-in) and forbidden responses.
  • Loading branch information
jimchamp authored Jan 14, 2025
2 parents 46c9ec6 + 09669a4 commit 042b544
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openlibrary/plugins/upstream/code.py
Original file line number Diff line number Diff line change
@@ -139,11 +139,14 @@ class merge_work(delegate.page):
def GET(self):
i = web.input(records='', mrid=None, primary=None)
user = web.ctx.site.get_user()

if user is None:
raise web.unauthorized()
has_access = user and (
(user.is_admin() or user.is_librarian()) or user.is_super_librarian()
)
if not has_access:
raise web.HTTPError('403 Forbidden')
raise web.forbidden()

optional_kwargs = {}
if not (user.is_admin() or user.is_super_librarian()):

0 comments on commit 042b544

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/internetarchive/openlibrary/commit/042b544

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy