projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac4f4ab
)
4189: Look up owner's writable_by when API did not provide writable_by for the object...
author
Tom Clegg <tom@curoverse.com>
Thu, 16 Oct 2014 20:09:16 +0000
(16:09 -0400)
committer
Brett Smith <brett@curoverse.com>
Thu, 16 Oct 2014 21:20:19 +0000
(17:20 -0400)
apps/workbench/app/models/arvados_base.rb
patch
|
blob
|
history
diff --git
a/apps/workbench/app/models/arvados_base.rb
b/apps/workbench/app/models/arvados_base.rb
index e0e93b9e2d0828cef0149f95fe51c817260ef3c7..31a5b58d2545af03b2043a3c7601a9fe131ac1a6 100644
(file)
--- a/
apps/workbench/app/models/arvados_base.rb
+++ b/
apps/workbench/app/models/arvados_base.rb
@@
-329,7
+329,9
@@
class ArvadosBase < ActiveRecord::Base
(current_user.is_admin or
current_user.uuid == self.owner_uuid or
new_record? or
- (writable_by.include? current_user.uuid rescue false))) or false
+ (respond_to?(:writable_by) ?
+ writable_by.include?(current_user.uuid) :
+ (ArvadosBase.find(owner_uuid).writable_by.include? current_user.uuid rescue false)))) or false
end
def attribute_editable?(attr, ever=nil)