19146: Remove unneeded special case checks, explain the needed one.
[arvados.git] / services / api / app / models / pipeline_template.rb
index cd0e5cb6095d6b95902803f621b875b430cef37e..7c694698e08edbccf5b390eccd453f1f2540c0ef 100644 (file)
@@ -1,4 +1,11 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 class PipelineTemplate < ArvadosModel
+  before_create :create_disabled
+  before_update :update_disabled
+
   include HasUuid
   include KindAndEtag
   include CommonApiTemplate
@@ -7,5 +14,18 @@ class PipelineTemplate < ArvadosModel
   api_accessible :user, extend: :common do |t|
     t.add :name
     t.add :components
+    t.add :description
+  end
+
+  def self.limit_index_columns_read
+    ["components"]
+  end
+
+  def create_disabled
+    raise "Disabled"
+  end
+
+  def update_disabled
+    raise "Disabled"
   end
 end