Sha256: 6751b745b9b0f1449f4e56f516caa914a6459e58750fbafb943d42ba77d201ac

Contents?: true

Size: 793 Bytes

Versions: 12

Compression:

Stored size: 793 Bytes

Contents

module Hyrax
  module SearchFilters
    extend ActiveSupport::Concern
    include Hyrax::FilterByType
    include 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

    private

      # TODO: could this be moved to Blacklight::AccessControls::Enforcement?
      def current_user_key
        current_user.user_key
      end

      # TODO: could this be moved to Blacklight::AccessControls::Enforcement?
      def current_user
        scope.current_user
      end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hyrax-2.0.3 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.2 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.1 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.rc3 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.rc2 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.rc1 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.beta5 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.beta4 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.beta3 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.beta2 app/search_builders/hyrax/search_filters.rb
hyrax-2.0.0.beta1 app/search_builders/hyrax/search_filters.rb