Class: Hyrax::GrantReadToMembersJob

Inherits:
ApplicationJob show all
Includes:
MembersPermissionJobBehavior
Defined in:
app/jobs/hyrax/grant_read_to_members_job.rb

Overview

Grants read access for the supplied user for the members attached to a work

Instance Method Summary collapse

Instance Method Details

#perform(work, user_key) ⇒ Object

Parameters:



8
9
10
11
12
13
14
# File 'app/jobs/hyrax/grant_read_to_members_job.rb', line 8

def perform(work, user_key)
  # Iterate over ids because reifying objects is slow.
  file_set_ids(work).each do |file_set_id|
    # Call this synchronously, since we're already in a job
    GrantReadJob.perform_now(file_set_id, user_key, use_valkyrie: use_valkyrie?(work))
  end
end