Sha256: bfc46f997f4182f6a1f0a3d76139ca63232590aaea7d6c01d399c46370fff8e5

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

# Added to allow for the My controller to show only things I have edit access to
class Sufia::MyCollectionsSearchBuilder < Sufia::SearchBuilder
  include Sufia::MySearchBuilderBehavior

  self.default_processor_chain += [
    :show_only_resources_deposited_by_current_user,
    :show_only_collections
  ]

  def show_only_collections(solr_parameters)
    solr_parameters[:fq] ||= []
    solr_parameters[:fq] += [
      ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: Collection.to_class_uri)
    ]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sufia-7.0.0.beta2 app/search_builders/sufia/my_collections_search_builder.rb