projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
16144: Adds more checks and simplifies nested conditionals.
[arvados.git]
/
services
/
api
/
app
/
models
/
group.rb
diff --git
a/services/api/app/models/group.rb
b/services/api/app/models/group.rb
index 7fb8fef42ba9e4c1b19967174cd30c9991383726..1f2b0d8b776a1f63ca94d0e3e7654e7f9cd5887b 100644
(file)
--- a/
services/api/app/models/group.rb
+++ b/
services/api/app/models/group.rb
@@
-16,6
+16,7
@@
class Group < ArvadosModel
# already know how to properly treat them.
attribute :properties, :jsonbHash, default: {}
# already know how to properly treat them.
attribute :properties, :jsonbHash, default: {}
+ validate :ensure_filesystem_compatible_name
after_create :invalidate_permissions_cache
after_update :maybe_invalidate_permissions_cache
before_create :assign_name
after_create :invalidate_permissions_cache
after_update :maybe_invalidate_permissions_cache
before_create :assign_name
@@
-31,6
+32,12
@@
class Group < ArvadosModel
t.add :properties
end
t.add :properties
end
+ def ensure_filesystem_compatible_name
+ # project groups need filesystem-compatible names, but others
+ # don't.
+ super if group_class == 'project'
+ end
+
def maybe_invalidate_permissions_cache
if uuid_changed? or owner_uuid_changed? or is_trashed_changed?
# This can change users' permissions on other groups as well as
def maybe_invalidate_permissions_cache
if uuid_changed? or owner_uuid_changed? or is_trashed_changed?
# This can change users' permissions on other groups as well as