def get_user_permissions(uid, **kwargs):
    """
        Get the roles for a user.
        @param user_id
    """
    try:
        _get_user(uid)

        user_perms = db.DBSession.query(Perm).filter(Perm.id==RolePerm.perm_id,
                                                  RolePerm.role_id==Role.id,
                                                  Role.id==RoleUser.role_id,
                                                  RoleUser.user_id==uid).all()
        return user_perms
    except:
        raise HydraError("Permissions not found for user (user_id={})".format(uid))
Get the roles for a user.
        @param user_id