fix permissions to accommodate nodes#ping and user_sessions#create exemptions
[arvados.git] / lib / current_api_client.rb
1 module CurrentApiClient
2   def current_user
3     Thread.current[:user]
4   end
5
6   def current_api_client
7     Thread.current[:api_client]
8   end
9
10   # Where is the client connecting from?
11   def current_api_client_ip_address
12     Thread.current[:api_client_ip_address]
13   end
14
15   # Is the current client permitted to perform ALL actions on behalf
16   # of the authenticated user?
17   def current_api_client_trusted
18     Thread.current[:api_client_trusted]
19   end
20 end