Module: Hyrax::Collections::ManagedCollectionsService

Defined in:
app/services/hyrax/collections/managed_collections_service.rb

Class Method Summary collapse

Class Method Details

.managed_collections_count(scope:) ⇒ Array<SolrDocument>

Count of collections the current user can manage.

Parameters:

  • scope (Object)

    Typically a controller object that responds to ‘repository`, `can?`, `blacklight_config`, `current_ability`

Returns:



10
11
12
13
# File 'app/services/hyrax/collections/managed_collections_service.rb', line 10

def self.managed_collections_count(scope:)
  query_builder = Hyrax::Dashboard::CollectionsSearchBuilder.new(scope).rows(0)
  scope.repository.search(query_builder.query).response["numFound"]
end