Class: Hyrax::My::CollectionsSearchBuilder
- Inherits:
-
CollectionSearchBuilder
- Object
- SearchBuilder
- CollectionSearchBuilder
- Hyrax::My::CollectionsSearchBuilder
- Includes:
- FilterByType, SearchBuilderBehavior
- Defined in:
- app/search_builders/hyrax/my/collections_search_builder.rb
Overview
Added to allow for the My controller to show only things I have edit access to
Instance Attribute Summary
Attributes inherited from CollectionSearchBuilder
Instance Method Summary collapse
-
#models ⇒ Array<Class>
This overrides the models in FilterByType.
-
#show_only_collections_deposited_by_current_user(solr_parameters) ⇒ Object
adds a filter to the solr_parameters that filters the collections and admin sets the current user has deposited.
Methods included from FilterByType
Methods included from SearchBuilderBehavior
Methods inherited from CollectionSearchBuilder
#add_sorting_to_solr, #discovery_permissions, #gated_discovery_filters, #sort_field, #with_access
Instance Method Details
#models ⇒ Array<Class>
This overrides the models in FilterByType
20 21 22 |
# File 'app/search_builders/hyrax/my/collections_search_builder.rb', line 20 def models Hyrax::ModelRegistry.admin_set_classes + Hyrax::ModelRegistry.collection_classes end |
#show_only_collections_deposited_by_current_user(solr_parameters) ⇒ Object
adds a filter to the solr_parameters that filters the collections and admin sets the current user has deposited
12 13 14 15 16 |
# File 'app/search_builders/hyrax/my/collections_search_builder.rb', line 12 def show_only_collections_deposited_by_current_user(solr_parameters) clauses = [query_for_my_collections] solr_parameters[:fq] ||= [] solr_parameters[:fq] += ["(#{clauses.join(' OR ')})"] end |