Sha256: 49d5fa481ac3bfbe398cce983da7de0f2d1e09025cd8daf4a19e2d44d3f47915

Contents?: true

Size: 736 Bytes

Versions: 16

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module Actors
    # Notify the provided owner that their proxy wants to make a
    # deposit on their behalf
    class TransferRequestActor < AbstractActor
      # @param [Hyrax::Actors::Environment] env
      # @return [Boolean] true if create was successful
      def create(env)
        next_actor.create(env) && create_proxy_deposit_request(env)
      end

      private

      def create_proxy_deposit_request(env)
        proxy = env.curation_concern.on_behalf_of
        return true if proxy.blank?
        work = env.curation_concern
        user = ::User.find_by_user_key(proxy)
        Hyrax::ChangeDepositorService.call(work, user, false)
        true
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-5.0.0 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-5.0.0.rc3 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-5.0.0.rc2 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-5.0.0.rc1 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-3.6.0 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-4.0.0 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-4.0.0.rc3 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-4.0.0.rc2 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-4.0.0.rc1 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-3.5.0 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-4.0.0.beta2 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-3.4.2 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-4.0.0.beta1 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-3.4.1 app/actors/hyrax/actors/transfer_request_actor.rb
hyrax-3.4.0 app/actors/hyrax/actors/transfer_request_actor.rb