projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change crunch-dispatch to use "git fetch-pack --all" insted of "git fetch" to
[arvados.git]
/
services
/
api
/
lib
/
has_uuid.rb
diff --git
a/services/api/lib/has_uuid.rb
b/services/api/lib/has_uuid.rb
index d9c819889f543f1acbc3ccfafc5a370137efb970..481d27a037ed4036561bf499e2ae94af6c71011d 100644
(file)
--- a/
services/api/lib/has_uuid.rb
+++ b/
services/api/lib/has_uuid.rb
@@
-28,12
+28,17
@@
module HasUuid
def assign_uuid
return true if !self.respond_to_uuid?
def assign_uuid
return true if !self.respond_to_uuid?
- return true if uuid and current_user and current_user.is_admin
+ if (uuid.is_a?(String) and uuid.length>0 and
+ current_user and current_user.is_admin)
+ return true
+ end
self.uuid = self.class.generate_uuid
end
def destroy_permission_links
self.uuid = self.class.generate_uuid
end
def destroy_permission_links
- Link.destroy_all(['link_class=? and (head_uuid=? or tail_uuid=?)',
- 'permission', uuid, uuid])
+ if uuid
+ Link.destroy_all(['link_class=? and (head_uuid=? or tail_uuid=?)',
+ 'permission', uuid, uuid])
+ end
end
end
end
end