Sha256: 6c92fb2730ead45397d1bc25bf3f279ae06640242abbabb744f7afd12448cbd2

Contents?: true

Size: 715 Bytes

Versions: 12

Compression:

Stored size: 715 Bytes

Contents

module CurationConcerns::SearchFilters
  extend ActiveSupport::Concern
  include CurationConcerns::FilterByType
  include CurationConcerns::FilterSuppressed

  # Override Hydra::AccessControlsEnforcement (or Hydra::PolicyAwareAccessControlsEnforcement)
  # Allows admin users to see everything (don't apply any gated_discovery_filters for those users)
  def gated_discovery_filters(permission_types = discovery_permissions, ability = current_ability)
    return [] if ability.admin?
    super
  end

  # show only files with edit permissions in lib/hydra/access_controls_enforcement.rb apply_gated_discovery
  def discovery_permissions
    return ['edit'] if blacklight_params[:works] == 'mine'
    super
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.7 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-2.0.0 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-2.0.0.rc2 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.6 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.5 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.4 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.3 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.2 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-2.0.0.rc1 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.1 app/search_builders/curation_concerns/search_filters.rb
curation_concerns-1.7.0 app/search_builders/curation_concerns/search_filters.rb