Class: Hyrax::AdminSetSearchBuilder
- Inherits:
-
SearchBuilder
- Object
- SearchBuilder
- Hyrax::AdminSetSearchBuilder
- Defined in:
- app/search_builders/hyrax/admin_set_search_builder.rb
Overview
Allows :deposit as a valid type
Direct Known Subclasses
Instance Method Summary collapse
-
#discovery_permissions ⇒ Object
Overrides Hydra::AccessControlsEnforcement.
-
#gated_discovery_filters ⇒ Array<String>
If :deposit access is requested, check to see which admin sets the user has deposit or manage access to.
-
#initialize(context, access) ⇒ AdminSetSearchBuilder
constructor
A new instance of AdminSetSearchBuilder.
-
#models ⇒ Object
This overrides the models in FilterByType.
Constructor Details
#initialize(context, access) ⇒ AdminSetSearchBuilder
Returns a new instance of AdminSetSearchBuilder.
10 11 12 13 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 10 def initialize(context, access) @access = access super(context) end |
Instance Method Details
#discovery_permissions ⇒ Object
Overrides Hydra::AccessControlsEnforcement
21 22 23 24 25 26 27 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 21 def if @access == :edit @discovery_permissions ||= ["edit"] else super end end |
#gated_discovery_filters ⇒ Array<String>
If :deposit access is requested, check to see which admin sets the user has deposit or manage access to.
32 33 34 35 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 32 def gated_discovery_filters return super if @access != :deposit ["{!terms f=id}#{admin_set_ids_for_deposit.join(',')}"] end |
#models ⇒ Object
This overrides the models in FilterByType
16 17 18 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 16 def models [::AdminSet, Hyrax::AdministrativeSet] end |