projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '3825-crunch-pipe-to-arv-put-final'
[arvados.git]
/
services
/
api
/
lib
/
current_api_client.rb
diff --git
a/services/api/lib/current_api_client.rb
b/services/api/lib/current_api_client.rb
index 6d85212eb96a5d1639e57d1453856999790f9de9..4c26010d2a4a3c0e6c38ae7911c2c9eb84eb822f 100644
(file)
--- a/
services/api/lib/current_api_client.rb
+++ b/
services/api/lib/current_api_client.rb
@@
-100,18
+100,24
@@
module CurrentApiClient
def act_as_system_user
if block_given?
def act_as_system_user
if block_given?
- user_was = Thread.current[:user]
- Thread.current[:user] = system_user
- begin
+ act_as_user system_user do
yield
yield
- ensure
- Thread.current[:user] = user_was
end
else
Thread.current[:user] = system_user
end
end
end
else
Thread.current[:user] = system_user
end
end
+ def act_as_user user
+ user_was = Thread.current[:user]
+ Thread.current[:user] = user
+ begin
+ yield
+ ensure
+ Thread.current[:user] = user_was
+ end
+ end
+
def anonymous_group
if not $anonymous_group
act_as_system_user do
def anonymous_group
if not $anonymous_group
act_as_system_user do