override Hyrax::WorkShowPresenter.authorized_item_ids to filter out p… #463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…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):
After (When not logged in):