def get_user_roles(self, uid, project_id=None):
        if project_id is None:
            roles = db.user_get_roles(context.get_admin_context(), uid)
            return roles
        else:
            roles = db.user_get_roles_for_project(context.get_admin_context(),
                                                  uid, project_id)
            return roles
Retrieve list of roles for user (or user and project)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/auth/dbdriver.py/DbDriver.get_user_roles