projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
5416: Allow users with repo write permission to update modified_at.
[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 d3802441317f21f5be00ccc194d16c2c7338037f..0e857ad15c22101d0d93e4b497479f3e14a6055d 100644
(file)
--- a/
services/api/app/models/group.rb
+++ b/
services/api/app/models/group.rb
@@
-7,6
+7,7
@@
class Group < ArvadosModel
include CanBeAnOwner
after_create :invalidate_permissions_cache
after_update :maybe_invalidate_permissions_cache
include CanBeAnOwner
after_create :invalidate_permissions_cache
after_update :maybe_invalidate_permissions_cache
+ before_create :assign_name
api_accessible :user, extend: :common do |t|
t.add :name
api_accessible :user, extend: :common do |t|
t.add :name
@@
-28,4
+29,12
@@
class Group < ArvadosModel
# immediately after being created.
User.invalidate_permissions_cache
end
# immediately after being created.
User.invalidate_permissions_cache
end
+
+ def assign_name
+ if self.new_record? and (self.name.nil? or self.name.empty?)
+ self.name = self.uuid
+ end
+ true
+ end
+
end
end