Class: Hyrax::My::SearchBuilder Abstract

Inherits:
SearchBuilder
  • Object
show all
Includes:
SearchBuilderBehavior
Defined in:
app/search_builders/hyrax/my/search_builder.rb

Overview

This class is abstract.

Search builder for things that the current user has deposited and has edit access to

Direct Known Subclasses

FindWorksSearchBuilder, WorksSearchBuilder

Instance Method Summary collapse

Methods included from SearchBuilderBehavior

#discovery_permissions

Instance Method Details

#show_only_resources_deposited_by_current_user(solr_parameters) ⇒ Object

adds a filter to the solr_parameters that filters the documents the current user has deposited

Parameters:

  • solr_parameters (Hash)

13
14
15
16
17
18
# File 'app/search_builders/hyrax/my/search_builder.rb', line 13

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