8128: Add runtime tokens for containers, and locks for multiple dispatchers
[arvados.git] / services / api / lib / current_api_client.rb
index 2e78612fc2d8b0ea3883cbb964d73c3e443e9c21..fbd4ef5f0c67933a7cc703d9f532c94fd601fc3d 100644 (file)
@@ -124,12 +124,18 @@ module CurrentApiClient
   end
 
   def act_as_user user
+    #auth_was = Thread.current[:api_client_authorization]
     user_was = Thread.current[:user]
     Thread.current[:user] = user
+    #Thread.current[:api_client_authorization] = ApiClientAuthorization.
+    #  where('user_id=? and scopes is null', user.id).
+    #  order('expires_at desc').
+    #  first
     begin
       yield
     ensure
       Thread.current[:user] = user_was
+      #Thread.current[:api_client_authorization] = auth_was
     end
   end