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

Set up location restriction message/allow pdf viewer to authorize location restriction #2630

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

hudajkhan
Copy link
Contributor

@hudajkhan hudajkhan commented Feb 21, 2025

Closes #2360

What this pull request does:

  • Adds location restriction methods to pdf viewer: does the purl object have a location restriction, and what is the location
  • Sets up a component to display the location restriction message based on a given location code
  • Displays the location restriction component in the PDF component display if the object has a location restriction
  • If the iiif auth (in file_auth_controller) returns an access denied message AND the file in question is the first file (i.e. the file which will have the render viewer method called and the PDF displayed in the screen), then an auth denied event is dispatched which will trigger the locked icon in the screen.
  • Allows an item that is restricted by location to be visible to a user at that location (i.e. when the authorization process returns success)
  • Extends the viewer.available function to also include location restricted cases, so the above scenario is now possible whereas before any location restricted case would immediately display the content not available method
  • Fixes a bug in the fallback message method which was needed a return statement

What this pull request does not do:
Check the authorization of files other than the first one to be rendered. This issue can address that separately: #2651

@hudajkhan hudajkhan marked this pull request as ready for review February 24, 2025 23:55
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.

Location-restricted PDFs do not display in the PDF viewer even at an authorized location
1 participant