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

override Hyrax::WorkShowPresenter.authorized_item_ids to filter out p… #463

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

cziaarm
Copy link
Collaborator

@cziaarm cziaarm commented Jul 27, 2023

…df_pages

Story

When a pdf is processed by iiif_print gem it produces a child work for each page using the pdf_page work type, so that these can be displayed in the universal viewer as images and get all that good paging stuff.

But Hyra/Hyku will lovingly display all the child works on the show page for the original pdf, which causes a big old list of oddly named files.

It can be a handy way for administrators to manage the page images, but for the general users it makes them sad and confused.

This PR overrides the WorkShowPresenters authorized_item_ids method adding a line to filter out works of type pdf_page, but only if there is not a logged in user (so admins still have a route to the child work show pages and beyond).

Expected Behaviour Before Changes

Work how pages for works with PDFs that have have been processed by iiif_print gem have all those child pdf_page works displayed.

Expected Behavior After Changes

Work how pages for works with PDFs that have have been processed by iiif_print gem only display members that are not pdf_pages

Screenshots / Video

Before (or when logged in):

image

After (When not logged in):

image

@cziaarm cziaarm merged commit d86db31 into main Sep 25, 2023
7 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.

1 participant