19139: Fixes bug by always setting owner_uuid to the system root user's UUID.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 14 Jul 2022 14:01:46 +0000 (11:01 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 14 Jul 2022 14:13:27 +0000 (11:13 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

services/api/app/models/user.rb

index d39695e27b19c82244c35e800db6107bf19cb950..1662278cc3edc0c4b9c681d51b1696c195b27a98 100644 (file)
@@ -350,6 +350,11 @@ SELECT target_uuid, perm_level
     self.save!
   end
 
+  # Called from ArvadosModel
+  def set_default_owner
+    self.owner_uuid = system_user_uuid
+  end
+
   def must_unsetup_to_deactivate
     if !self.new_record? &&
        self.uuid[0..4] == Rails.configuration.Login.LoginCluster &&