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