projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
show cli update example on generic object#get page
[arvados.git]
/
apps
/
workbench
/
app
/
models
/
arvados_base.rb
diff --git
a/apps/workbench/app/models/arvados_base.rb
b/apps/workbench/app/models/arvados_base.rb
index baceae968540a8da20fa6c9dc0ee580a85ef0d6e..267a4a9133ef1c9b5c05372488faa349d0ae332e 100644
(file)
--- a/
apps/workbench/app/models/arvados_base.rb
+++ b/
apps/workbench/app/models/arvados_base.rb
@@
-204,6
+204,10
@@
class ArvadosBase < ActiveRecord::Base
}
end
}
end
+ def self.creatable?
+ current_user
+ end
+
def editable?
(current_user and
(current_user.is_admin or
def editable?
(current_user and
(current_user.is_admin or
@@
-216,7
+220,7
@@
class ArvadosBase < ActiveRecord::Base
elsif "uuid owner".index(attr.to_s)
current_user and current_user.is_admin
else
elsif "uuid owner".index(attr.to_s)
current_user and current_user.is_admin
else
- true
+ current_user and current_user.uuid == owner
end
end
end
end
@@
-257,7
+261,11
@@
class ArvadosBase < ActiveRecord::Base
self
end
self
end
- def current_user
+ def self.current_user
+ Thread.current[:user] ||= User.current if Thread.current[:arvados_api_token]
Thread.current[:user]
end
Thread.current[:user]
end
+ def current_user
+ self.class.current_user
+ end
end
end