Module: Hydra::WithDepositor

Defined in:
app/models/concerns/hydra/with_depositor.rb

Instance Method Summary collapse

Instance Method Details

#apply_depositor_metadata(depositor) ⇒ Object

Adds metadata about the depositor to the asset and grants edit permissions to the depositor

Parameters:

  • depositor (String, #user_key)


5
6
7
8
9
10
11
12
13
# File 'app/models/concerns/hydra/with_depositor.rb', line 5

def (depositor)
  depositor_id = depositor.respond_to?(:user_key) ? depositor.user_key : depositor

  if respond_to? :depositor
    self.depositor = depositor_id
  end
  self.edit_users += [depositor_id]
  true
end