Sha256: 35d9198eccc7aade3f99b22602eec8abcd65f22a234b698a50cd58db4cc9ca33
Contents?: true
Size: 890 Bytes
Versions: 9
Compression:
Stored size: 890 Bytes
Contents
# frozen_string_literal: true module Hyrax module Workflow ## # This is a built in function for workflow, so that a workflow action can be created that # grants the creator the ability to view their work. module GrantReadToDepositor # @param [#read_users=, #read_users] target to which we are adding read_users # for the depositor # @return void def self.call(target:, **) return true unless target.try(:depositor) model = target.try(:model) || target # get the model if target is a ChangeSet model.read_users += Array.wrap(target.depositor) model.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. GrantReadToMembersJob.perform_later(model, target.depositor) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems