Class: Hyrax::GrantEditToMembersJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/hyrax/grant_edit_to_members_job.rb

Overview

Grants edit 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:

  • work (ActiveFedora::Base)
    • the work object

  • user_key (String)
    • the user to add



8
9
10
11
12
13
14
# File 'app/jobs/hyrax/grant_edit_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
    GrantEditJob.perform_now(file_set_id, user_key)
  end
end