Module: Blacklight::AccessControls::Catalog
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/blacklight/access_controls/catalog.rb
Overview
This is behavior for the catalog controller.
Instance Method Summary collapse
-
#enforce_show_permissions(_opts = {}) ⇒ Object
Controller “before” filter for enforcing access controls on show actions.
-
#search_builder ⇒ Object
This will work for BL 6, but will need to move to SearchService in BL 7.
Instance Method Details
#enforce_show_permissions(_opts = {}) ⇒ Object
Controller “before” filter for enforcing access controls on show actions.
11 12 13 14 15 16 17 |
# File 'lib/blacklight/access_controls/catalog.rb', line 11 def (_opts = {}) = current_ability.(params[:id]) unless can? :read, raise Blacklight::AccessControls::AccessDenied.new('You do not have sufficient access privileges to read this document, which has been marked private.', :read, params[:id]) end end |
#search_builder ⇒ Object
This will work for BL 6, but will need to move to SearchService in BL 7
20 21 22 |
# File 'lib/blacklight/access_controls/catalog.rb', line 20 def search_builder Blacklight::AccessControls::SearchBuilder.new(self, ability: current_ability) end |