Class: Hyrax::Dashboard::WorksSearchBuilder
- Inherits:
-
WorksSearchBuilder
- Object
- SearchBuilder
- SearchBuilder
- WorksSearchBuilder
- Hyrax::Dashboard::WorksSearchBuilder
- Includes:
- ManagedSearchFilters
- Defined in:
- app/search_builders/hyrax/dashboard/works_search_builder.rb
Instance Method Summary collapse
-
#show_only_managed_works_for_non_admins(solr_parameters) ⇒ Object
Adds a filter to exclude works created by the current user if the current user is not an admin.
Methods included from ManagedSearchFilters
#add_managing_role_search_filter, #apply_group_permissions, #discovery_permissions
Methods inherited from WorksSearchBuilder
Methods included from FilterByType
Instance Method Details
#show_only_managed_works_for_non_admins(solr_parameters) ⇒ Object
Adds a filter to exclude works created by the current user if the current user is not an admin.
12 13 14 15 16 |
# File 'app/search_builders/hyrax/dashboard/works_search_builder.rb', line 12 def show_only_managed_works_for_non_admins(solr_parameters) return if current_ability.admin? solr_parameters[:fq] ||= [] solr_parameters[:fq] << '-' + ActiveFedora::SolrQueryBuilder.construct_query_for_rel(depositor: current_user_key) end |