X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/872cf2e096a7b72722aa76040339a23e962cdf96..42c20b25e1325124b88e3b9b285544dc41122b56:/apps/workbench/app/models/group.rb diff --git a/apps/workbench/app/models/group.rb b/apps/workbench/app/models/group.rb index 558c587a1c..ea3da2db5e 100644 --- a/apps/workbench/app/models/group.rb +++ b/apps/workbench/app/models/group.rb @@ -1,8 +1,16 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class Group < ArvadosBase def self.goes_in_projects? true end + def self.copies_to_projects? + false + end + def self.contents params={} res = arvados_api_client.api self, "/contents", { _method: 'GET' @@ -12,6 +20,13 @@ class Group < ArvadosBase ret end + def editable? + if group_class == 'filter' + return false + end + super + end + def contents params={} res = arvados_api_client.api self.class, "/#{self.uuid}/contents", { _method: 'GET' @@ -22,12 +37,18 @@ class Group < ArvadosBase end def class_for_display - group_class == 'project' ? 'Project' : super + (group_class == 'project' or group_class == 'filter') ? 'Project' : super end - def editable? - respond_to?(:writable_by) and - writable_by and - writable_by.index(current_user.uuid) + def textile_attributes + [ 'description' ] + end + + def self.creatable? + false + end + + def untrash + arvados_api_client.api(self.class, "/#{self.uuid}/untrash", {"ensure_unique_name" => true}) end end