Module: Sufia::ModelMethods
- Extended by:
- ActiveSupport::Concern
- Includes:
- Hydra::ModelMethods
- Included in:
- Batch, GenericFile
- Defined in:
- lib/sufia/model_methods.rb
Instance Method Summary collapse
-
#apply_depositor_metadata(depositor_id) ⇒ Object
OVERRIDE to support Hydra::Datastream::Properties which does not respond to :depositor_values but :depositor Adds metadata about the depositor to the asset Most important behavior: if the asset has a rightsMetadata datastream, this method will add
depositor_id
to its individual edit permissions.
Instance Method Details
#apply_depositor_metadata(depositor_id) ⇒ Object
OVERRIDE to support Hydra::Datastream::Properties which does not
respond to :depositor_values but :depositor
Adds metadata about the depositor to the asset Most important behavior: if the asset has a rightsMetadata datastream, this method will add depositor_id
to its individual edit permissions.
26 27 28 29 30 31 32 33 34 |
# File 'lib/sufia/model_methods.rb', line 26 def (depositor_id) rights_ds = self.datastreams["rightsMetadata"] prop_ds = self.datastreams["properties"] rights_ds.update_indexed_attributes([:edit_access, :person]=>depositor_id) unless rights_ds.nil? prop_ds.depositor = depositor_id unless prop_ds.nil? return true end |