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.
9 10 11 12 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 9 def initialize(context, access) @access = access super(context) end |
Instance Method Details
#discovery_permissions ⇒ Object
Overrides Hydra::AccessControlsEnforcement
20 21 22 23 24 25 26 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 20 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.
31 32 33 34 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 31 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
15 16 17 |
# File 'app/search_builders/hyrax/admin_set_search_builder.rb', line 15 def models [::AdminSet] end |