Sha256: ff974b2a735df31411c45586562fce63a3a56ddc0bbf5b3c8d6b02e3bce18d86

Contents?: true

Size: 441 Bytes

Versions: 2

Compression:

Stored size: 441 Bytes

Contents

module Spotlight::Catalog::AccessControlsEnforcement
  extend ActiveSupport::Concern

  included do
    self.solr_search_params_logic << :apply_permissive_visibility_filter
  end

  protected

  def apply_permissive_visibility_filter solr_params, user_params
    return if respond_to? :can? and can? :curate, current_exhibit
    solr_params.append_filter_query "-#{Spotlight::SolrDocument.visibility_field(current_exhibit)}:false"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-spotlight-0.2.0 lib/spotlight/catalog/access_controls_enforcement.rb
blacklight-spotlight-0.1.0 lib/spotlight/catalog/access_controls_enforcement.rb