Module: Hyrax::SearchFilters

Extended by:
ActiveSupport::Concern
Includes:
FilterByType, FilterSuppressed
Defined in:
app/search_builders/hyrax/search_filters.rb

Instance Method Summary collapse

Methods included from FilterSuppressed

#only_active_works

Methods included from FilterByType

#filter_models

Instance Method Details

#gated_discovery_filters(permission_types = discovery_permissions, ability = current_ability) ⇒ Object

Override Hydra::AccessControlsEnforcement (or Hydra::PolicyAwareAccessControlsEnforcement) Allows admin users to see everything (don't apply any gated_discovery_filters for those users)


18
19
20
21
# File 'app/search_builders/hyrax/search_filters.rb', line 18

def gated_discovery_filters(permission_types = discovery_permissions, ability = current_ability)
  return [] if ability.admin?
  super
end

#with_access(access) ⇒ SearchBuilder

TODO: move this to Hydra::AccessControlsEnforcement

Parameters:

  • access (String)

    what access level to set. Either 'read' or 'edit'

Returns:


11
12
13
14
# File 'app/search_builders/hyrax/search_filters.rb', line 11

def with_access(access)
  @discovery_permissions = Array.wrap(access)
  self
end