def authorize_user_context(context, user_id):
    'Ensures a request has permission to access the given user.'
    if is_user_context(context):
        if (not context.user_id):
            raise exception.Forbidden()
        elif (context.user_id != user_id):
            raise exception.Forbidden()
Ensures a request has permission to access the given user.
def authorize_user_context(context, user_id):
    
    if is_user_context(context):
        if (not context.user_id):
            raise exception.Forbidden()
        elif (context.user_id != user_id):
            raise exception.Forbidden()