Sha256: 42103242480fd1785708870842c56e303857879d4057ce358c4c61c899499aa6
Contents?: true
Size: 697 Bytes
Versions: 26
Compression:
Stored size: 697 Bytes
Contents
# frozen_string_literal: true module Hyrax module Dashboard class WorksSearchBuilder < Hyrax::WorksSearchBuilder include Hyrax::Dashboard::ManagedSearchFilters self.default_processor_chain += [:show_only_managed_works_for_non_admins] # Adds a filter to exclude works created by the current user if the # current user is not an admin. # @param [Hash] solr_parameters 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 end end end
Version data entries
26 entries across 26 versions & 1 rubygems