Sha256: 61267549768fd4cc820dc4179ee1605c161e830eeb01465391a2a258e8fcc998

Contents?: true

Size: 757 Bytes

Versions: 17

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  # Grants read access for the supplied user for the members attached to a work
  module MembersPermissionJobBehavior
    extend ActiveSupport::Concern

    included do
      queue_as Hyrax.config.ingest_queue_name
    end

    private

    # Filter the member ids and return only the FileSet ids (filter out child works)
    # @return [Array<String>] the file set ids
    def file_set_ids(work)
      case work
      when ActiveFedora::Base
        ::FileSet.search_with_conditions(id: work.member_ids).map(&:id)
      when Valkyrie::Resource
        Hyrax.custom_queries.find_child_file_set_ids(resource: work)
      end
    end

    def use_valkyrie?(work)
      work.is_a? Valkyrie::Resource
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
hyrax-5.0.2 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-5.0.1 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-5.0.0 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-5.0.0.rc3 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-5.0.0.rc2 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-5.0.0.rc1 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-3.6.0 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-4.0.0 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-4.0.0.rc3 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-4.0.0.rc2 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-4.0.0.rc1 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-3.5.0 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-4.0.0.beta2 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-3.4.2 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-4.0.0.beta1 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-3.4.1 app/jobs/concerns/hyrax/members_permission_job_behavior.rb
hyrax-3.4.0 app/jobs/concerns/hyrax/members_permission_job_behavior.rb