Module ImportFrom alias alias FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str SubscriptLoad NameLoad Index Str Dict Str ListLoad Str If CompareIs NameLoad NameLoad body Return NameLoad orelse Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args NameParam defaults vararg kwarg body ImportFrom alias Assign AttributeStore NameLoad attr NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str If Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return Call NameLoad Str If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad CompareNotIn AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str body Return Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return Call NameLoad keyword Num decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list
N/A django.http HttpResponse HttpResponseBadRequest is_admin N/A N/A user N/A N/A N/A 
    Tests for 'admin' role on a user_id. Returns True/False.
     api.models db_model N/A dbc N/A N/A db_model connect N/A user N/A N/A N/A dbc hbuser find_one N/A username roles N/A user N/A username N/A $in N/A admin N/A N/A user None N/A N/A False N/A N/A True N/A RequireLogin N/A object N/A N/A 
    This decorator inspects incoming HTTP request dictionaries for a X-AUTH-TOKEN header.

    If the token is found, it is validated. If the token is invalid or missing, http 401 is returned.
     __init__ N/A N/A self role N/A None N/A N/A N/A self f None N/A N/A self required_role role N/A N/A self token_string INVALID N/A N/A self username None N/A N/A self user None N/A __call__ N/A N/A self f N/A N/A wrapped_f N/A N/A request N/A pargs kwargs N/A django.http HttpResponseForbidden N/A N/A self f f N/A N/A HTTP_X_AUTH_TOKEN N/A request META N/A N/A N/A self token_string N/A N/A request META N/A HTTP_X_AUTH_TOKEN N/A N/A N/A self valid_token N/A N/A user N/A N/A self fetch_user N/A N/A user None N/A N/A N/A HttpResponseBadRequest Could not obtain user information N/A N/A N/A N/A self required_role None N/A N/A self required_role N/A user N/A roles N/A N/A N/A HttpResponseForbidden N/A N/A request user user N/A N/A request token_string N/A self token_string N/A N/A N/A self f request pargs kwargs N/A N/A HttpResponse status 401 N/A N/A wrapped_f N/A fetch_user N/A N/A self N/A N/A N/A 
        Return user matching self.username, otherwise None
         api.models db_model N/A dbc N/A N/A db_model connect N/A N/A N/A N/A dbc hbuser find_one N/A username N/A self username N/A valid_token N/A N/A self N/A N/A N/A 
        Validate token in self.token_string against redis backend.
         api.models redis_wrapper django.conf settings N/A r N/A N/A redis_wrapper init_redis N/A username N/A N/A r get N/A self token_string N/A N/A username None N/A N/A False N/A N/A N/A self username username N/A N/A N/A r expire N/A self token_string N/A settings TOKEN_TTL N/A True N/A N/A