X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9e17d8df4c60295ce81bd229e723dc37b7b98b9b..02f24a0c4a01a7ab46645c21630b9f48065b4b96:/services/api/app/models/group.rb diff --git a/services/api/app/models/group.rb b/services/api/app/models/group.rb index 6105b5f35d..fe183678c1 100644 --- a/services/api/app/models/group.rb +++ b/services/api/app/models/group.rb @@ -1,10 +1,17 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'can_be_an_owner' +require 'trashable' class Group < ArvadosModel include HasUuid include KindAndEtag include CommonApiTemplate include CanBeAnOwner + include Trashable + after_create :invalidate_permissions_cache after_update :maybe_invalidate_permissions_cache before_create :assign_name @@ -14,10 +21,13 @@ class Group < ArvadosModel t.add :group_class t.add :description t.add :writable_by + t.add :delete_at + t.add :trash_at + t.add :is_trashed end def maybe_invalidate_permissions_cache - if uuid_changed? or owner_uuid_changed? + if uuid_changed? or owner_uuid_changed? or is_trashed_changed? # This can change users' permissions on other groups as well as # this one. invalidate_permissions_cache