Class: Hyrax::SingleUseLinksViewerController
- Inherits:
-
DownloadsController
- Object
- ApplicationController
- DownloadsController
- Hyrax::SingleUseLinksViewerController
- Includes:
- ActionDispatch::Routing::PolymorphicRoutes, Blacklight::AccessControls::Catalog, Blacklight::Base
- Defined in:
- app/controllers/hyrax/single_use_links_viewer_controller.rb
Defined Under Namespace
Classes: Ability
Instance Method Summary collapse
Methods inherited from DownloadsController
Methods included from WorkflowsHelper
Methods included from ValkyrieDownloadsControllerBehavior
Instance Method Details
#download ⇒ Object
20 21 22 23 |
# File 'app/controllers/hyrax/single_use_links_viewer_controller.rb', line 20 def download raise not_found_exception unless single_use_link.path == hyrax.download_path(id: @asset) send_content end |
#show ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/hyrax/single_use_links_viewer_controller.rb', line 25 def show # Authorize using SingleUseLinksViewerController::Ability :read, curation_concern raise not_found_exception unless single_use_link.path == polymorphic_path([main_app, curation_concern]) # show the file @presenter = presenter_class.new(curation_concern, current_ability) # create a dowload link that is single use for the user since we do not just want to show metadata we want to access it too @su = single_use_link.create_for_path hyrax.download_path(curation_concern.id) @download_link = hyrax.download_single_use_link_path(@su.download_key) end |