Sha256: b841d8e8fabd63eade563da1e6c8de13c21afc154bc1a4be05547a224b14c947

Contents?: true

Size: 763 Bytes

Versions: 48

Compression:

Stored size: 763 Bytes

Contents

module Hyrax
  module My
    # Search builder for things that the current user has deposited and has edit access to
    # @abstract
    class SearchBuilder < ::SearchBuilder
      # Check for edit access
      include Hyrax::My::SearchBuilderBehavior
      self.default_processor_chain += [:show_only_resources_deposited_by_current_user]

      # adds a filter to the solr_parameters that filters the documents the current user
      # has deposited
      # @param [Hash] solr_parameters
      def show_only_resources_deposited_by_current_user(solr_parameters)
        solr_parameters[:fq] ||= []
        solr_parameters[:fq] += [
          ActiveFedora::SolrQueryBuilder.construct_query_for_rel(depositor: current_user_key)
        ]
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.9.5 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.9.4 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.9.3 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.9.2 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.9.1 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.9.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.8.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.7.2 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.7.1 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.7.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.6.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.0.0.pre.rc1 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.0.0.pre.beta3 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.5.1 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.5.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.0.0.pre.beta2 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.4.1 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.0.0.pre.beta1 app/search_builders/hyrax/my/search_builder.rb
hyrax-2.4.0 app/search_builders/hyrax/my/search_builder.rb