X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/691a08fd486e53ce656ae20fea84c2b3ec1a1088..6f1c0e1dd16f53ce4fb7e8785a130e5f588500e5:/services/api/app/models/container_request.rb diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb index 83ca3346de..496a6b141d 100644 --- a/services/api/app/models/container_request.rb +++ b/services/api/app/models/container_request.rb @@ -129,8 +129,8 @@ class ContainerRequest < ArvadosModel errors.add :priority, "cannot be nil" end - # Can update priority, container count. - permitted.push :priority, :container_count_max, :container_uuid + # Can update priority, container count, name and description + permitted.push :priority, :container_count_max, :container_uuid, :name, :description if self.state_changed? # Allow create-and-commit in a single operation. @@ -141,12 +141,12 @@ class ContainerRequest < ArvadosModel end when Final - if not current_user.andand.is_admin + if not current_user.andand.is_admin and not (self.name_changed? || self.description_changed?) errors.add :state, "of container request can only be set to Final by system." end - if self.state_changed? - permitted.push :state + if self.state_changed? || self.name_changed? || self.description_changed? + permitted.push :state, :name, :description else errors.add :state, "does not allow updates" end