mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #2243 from martenson/check-curr-ts-user
add TS API to check current user
This commit is contained in:
@@ -95,12 +95,18 @@ class UsersController( BaseAPIController ):
|
||||
def show( self, trans, id, **kwd ):
|
||||
"""
|
||||
GET /api/users/{encoded_user_id}
|
||||
GET /api/users/current
|
||||
Returns a dictionary of information about a user.
|
||||
|
||||
:param id: the encoded id of the User object.
|
||||
"""
|
||||
# Example URL: http://localhost:9009/api/users/f9cad7b01a472135
|
||||
user = suc.get_user( trans.app, id )
|
||||
user = None
|
||||
# user is requesting data about themselves
|
||||
if id == "current" and trans.user:
|
||||
user = trans.user
|
||||
else:
|
||||
user = suc.get_user( trans.app, id )
|
||||
|
||||
if user is None:
|
||||
user_dict = dict( message='Unable to locate user record for id %s.' % ( str( id ) ),
|
||||
status='error' )
|
||||
|
||||
Reference in New Issue
Block a user