Sha256: 160e246d308381c917ab7127015c43c66088ad6e9f3d86588bec7413440e6db1

Contents?: true

Size: 678 Bytes

Versions: 48

Compression:

Stored size: 678 Bytes

Contents

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 (likely an ActiveRecord::Base) to which we are adding read_users for the depositor
      # @return void
      def self.call(target:, **)
        target.read_users += [target.depositor]
        # 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(target, target.depositor)
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.9.5 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.9.4 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.9.3 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.9.2 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.9.1 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.9.0 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.8.0 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.7.2 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.7.1 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.7.0 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.6.0 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-3.0.0.pre.rc1 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-3.0.0.pre.beta3 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.5.1 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.5.0 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-3.0.0.pre.beta2 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.4.1 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-3.0.0.pre.beta1 app/services/hyrax/workflow/grant_read_to_depositor.rb
hyrax-2.4.0 app/services/hyrax/workflow/grant_read_to_depositor.rb