Sha256: bbabd4b5f77fc6eef06a1b3aceb9bcfee4d50a46f3030b97fb63b02257daedd9

Contents?: true

Size: 793 Bytes

Versions: 28

Compression:

Stored size: 793 Bytes

Contents

# frozen_string_literal: true
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

28 entries across 28 versions & 1 rubygems

Version Path
hyrax-5.0.4 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.3 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.2 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.1 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.0.rc3 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.0.rc2 app/search_builders/hyrax/my/search_builder.rb
hyrax-5.0.0.rc1 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.6.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-4.0.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-4.0.0.rc3 app/search_builders/hyrax/my/search_builder.rb
hyrax-4.0.0.rc2 app/search_builders/hyrax/my/search_builder.rb
hyrax-4.0.0.rc1 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.5.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-4.0.0.beta2 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.4.2 app/search_builders/hyrax/my/search_builder.rb
hyrax-4.0.0.beta1 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.4.1 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.4.0 app/search_builders/hyrax/my/search_builder.rb
hyrax-3.3.0 app/search_builders/hyrax/my/search_builder.rb