Sha256: fe8f92a475535b21012ea8488a3f5dafa57861c625e09e27544e2b59371fad30

Contents?: true

Size: 633 Bytes

Versions: 10

Compression:

Stored size: 633 Bytes

Contents

# frozen_string_literal: true

module Bulkrax
  module ImportersHelper
    # borrowed from batch-importer https://github.com/samvera-labs/hyrax-batch_ingest/blob/main/app/controllers/hyrax/batch_ingest/batches_controller.rb
    def available_admin_sets
      # Restrict available_admin_sets to only those current user can deposit to.
      @available_admin_sets ||= Hyrax::Collections::PermissionsService.source_ids_for_deposit(ability: current_ability, source_type: 'admin_set').map do |admin_set_id|
        [Bulkrax.object_factory.find_or_nil(admin_set_id)&.title&.first || admin_set_id, admin_set_id]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bulkrax-9.0.2 app/helpers/bulkrax/importers_helper.rb
bulkrax-9.0.1 app/helpers/bulkrax/importers_helper.rb
bulkrax-9.0.0 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.2.3 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.2.2 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.3.0 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.2.1 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.2.0 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.1.0 app/helpers/bulkrax/importers_helper.rb
bulkrax-8.0.0 app/helpers/bulkrax/importers_helper.rb