commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/a85ae05b837c/ Changeset: a85ae05b837c User: dannon Date: 2013-04-03 15:59:33 Summary: User API: requesting current user allows anonymous access. Affected #: 1 file diff -r da459ec80aae65dcb918c9601f091be1f4a74ee8 -r a85ae05b837cbad8abb059e0fa6898c4c0634317 lib/galaxy/webapps/galaxy/api/users.py --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -44,7 +44,7 @@ rval.append( item ) return rval - @web.expose_api + @web.expose_api_anonymous def show( self, trans, id, deleted='False', **kwd ): """ GET /api/users/{encoded_user_id} https://bitbucket.org/galaxy/galaxy-central/commits/ca242dca4762/ Changeset: ca242dca4762 User: dannon Date: 2013-04-03 16:01:39 Summary: api/users - Format spacing, trim trailing spaces. Affected #: 1 file diff -r a85ae05b837cbad8abb059e0fa6898c4c0634317 -r ca242dca4762b4c299f1bffae13c59e2ffd1e03c lib/galaxy/webapps/galaxy/api/users.py --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -8,7 +8,9 @@ log = logging.getLogger( __name__ ) + class UserAPIController( BaseAPIController ): + @web.expose_api def index( self, trans, deleted='False', **kwd ): """ @@ -66,26 +68,22 @@ user = trans.user else: user = self.get_user( trans, id, deleted=deleted ) - # check that the user is requesting themselves (and they aren't del'd) unless admin if not trans.user_is_admin(): assert trans.user == user assert not user.deleted - except: if trans.user_is_admin(): raise else: raise HTTPBadRequest( detail='Invalid user id ( %s ) specified' % id ) - item = user.get_api_value( view='element', value_mapper={ 'id': trans.security.encode_id, - 'total_disk_usage': float } ) + 'total_disk_usage': float } ) #TODO: move into api_values (needs trans, tho - can we do that with api_keys/@property??) #TODO: works with other users (from admin)?? item['quota_percent'] = trans.app.quota_agent.get_percent( trans=trans ) + return item - return item - @web.expose_api def create( self, trans, payload, **kwd ): """ @@ -97,7 +95,7 @@ if trans.app.config.use_remote_user and trans.user_is_admin(): user = trans.get_or_create_remote_user(remote_user_email=payload['remote_user_email']) item = user.get_api_value( view='element', value_mapper={ 'id': trans.security.encode_id, - 'total_disk_usage': float } ) + 'total_disk_usage': float } ) else: raise HTTPNotImplemented() return item Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org