Sha256: 7d1db8af5d5d8c7e791236f1fc2742b00362e1743e4602af97a7f291b1b498f1

Contents?: true

Size: 734 Bytes

Versions: 16

Compression:

Stored size: 734 Bytes

Contents

module CurationConcerns
  class CollectionsService
    attr_reader :context

    class_attribute :list_search_builder_class
    self.list_search_builder_class = CurationConcerns::CollectionSearchBuilder

    # @param [#repository,#blacklight_config,#current_ability] context
    def initialize(context)
      @context = context
    end

    # @param [Symbol] access :read or :edit
    def search_results(access)
      builder = list_search_builder(access)
      response = context.repository.search(builder)
      response.documents
    end

    private

      def list_search_builder(access)
        list_search_builder_class.new(context).tap do |builder|
          builder.discovery_perms = [access]
        end
      end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.7 app/services/curation_concerns/collections_service.rb
curation_concerns-2.0.0 app/services/curation_concerns/collections_service.rb
curation_concerns-2.0.0.rc2 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.6 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.5 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.4 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.3 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.2 app/services/curation_concerns/collections_service.rb
curation_concerns-2.0.0.rc1 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.1 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.0 app/services/curation_concerns/collections_service.rb
curation_concerns-1.7.0.beta1 app/services/curation_concerns/collections_service.rb
curation_concerns-1.6.3 app/services/curation_concerns/collections_service.rb
curation_concerns-1.6.2 app/services/curation_concerns/collections_service.rb
curation_concerns-1.6.1 app/services/curation_concerns/collections_service.rb