Class: Hyrax::ChangeContentDepositorService

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/change_content_depositor_service.rb

Class Method Summary collapse

Class Method Details

.call(work, user, reset) ⇒ Object

Parameters:

  • work (ActiveFedora::Base)
  • user (User)
  • reset (TrueClass, FalseClass)


6
7
8
9
10
11
12
13
14
15
16
# File 'app/services/hyrax/change_content_depositor_service.rb', line 6

def self.call(work, user, reset)
  work.proxy_depositor = work.depositor
  work.permissions = [] if reset
  work.(user)
  work.file_sets.each do |f|
    f.(user)
    f.save!
  end
  work.save!
  work
end