X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e488ae9a299575bdf3d449a72e85fc65294a1390..a326799df9f652cd3bbee7956ea8a912d6acc4bd:/app/models/orvos_model.rb diff --git a/app/models/orvos_model.rb b/app/models/orvos_model.rb index 49f24dba36..bdd27a67c3 100644 --- a/app/models/orvos_model.rb +++ b/app/models/orvos_model.rb @@ -32,11 +32,13 @@ class OrvosModel < ActiveRecord::Base def permission_to_update return false unless current_user - if self.owner_changed? and self.owner_was != current_user.uuid - return Metadatum.where(metadata_class: 'permission', + if self.owner_changed? and + self.owner_was != current_user.uuid and + 0 == Metadatum.where(metadata_class: 'permission', name: 'can_pillage', tail: self.owner, - head: current_user.uuid).count > 0 + head: current_user.uuid).count + return false end self.owner == current_user.uuid or current_user.is_admin or