Module: Hydra::Catalog
- Extended by:
- ActiveSupport::Concern
- Includes:
- Blacklight::AccessControls::Catalog, Blacklight::Catalog
- Included in:
- CatalogController
- Defined in:
- app/controllers/concerns/hydra/catalog.rb
Instance Method Summary collapse
-
#enforce_show_permissions(opts = {}) ⇒ Object
Action-specific enforcement Controller “before” filter for enforcing access controls on show actions.
Instance Method Details
#enforce_show_permissions(opts = {}) ⇒ Object
Action-specific enforcement Controller “before” filter for enforcing access controls on show actions
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/concerns/hydra/catalog.rb', line 9 def (opts={}) # The "super" method comes from blacklight-access_controls. # It will check the read permissions for the record. # By default, it will return a Hydra::PermissionsSolrDocument # that contains the permissions fields for that record # so that you can perform additional permissions checks. = super if . && !can?(:edit, ) raise Hydra::AccessDenied.new("This item is under embargo. You do not have sufficient access privileges to read this document.", :edit, params[:id]) end end |