Sha256: 129cccc68ce8ba6ce6bbf7e966433af9c637e03232ea99de5fe558151161bc79

Contents?: true

Size: 670 Bytes

Versions: 1

Compression:

Stored size: 670 Bytes

Contents

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

  # 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

1 entries across 1 versions & 1 rubygems

Version Path
curation_concerns-1.7.0.beta1 app/search_builders/curation_concerns/search_filters.rb