Module: Hyrax::Workflow::GrantEditToDepositor
- Defined in:
- app/services/hyrax/workflow/grant_edit_to_depositor.rb
Overview
This is a built in function for workflow, so that a workflow action can be created that grants the creator the ability to alter it.
Class Method Summary collapse
-
.call(target:) ⇒ Object
Void.
Class Method Details
.call(target:) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/services/hyrax/workflow/grant_edit_to_depositor.rb', line 9 def self.call(target:, **) return true unless target.try(:depositor) target.edit_users = target.edit_users.to_a + Array.wrap(target.depositor) # += works in Ruby 2.6+ target.try(:permission_manager)&.acl&.save # If there are a lot of members, granting access to each could take a # long time. Do this work in the background. GrantEditToMembersJob.perform_later(target, target.depositor) end |