20877: Do not create log or output collections if parent is frozen or trashed
[arvados.git] / services / api / app / models / group.rb
index 09bb8af97d24f4ebbfb0aa375e2a92e39e98f4fe..5c0aeba589aa65867bd30c48dd56fd9a8fce3193 100644 (file)
@@ -49,6 +49,12 @@ class Group < ArvadosModel
     t.add :can_manage
   end
 
+  # check if admins are allowed to make changes to the project, e.g. it
+  # isn't trashed or frozen.
+  def admin_change_permitted
+    !(FrozenGroup.where(uuid: self.uuid).any? || TrashedGroup.where(group_uuid: self.uuid).any?)
+  end
+
   protected
 
   def self.attributes_required_columns