@Override
  public void revokeRoleFromUser(String roleName, String userName) throws AuthException {
    if (isAdmin(userName)) {
      throw new AuthException(
          TSStatusCode.NO_PERMISSION, "Invalid operation, cannot revoke role from administrator ");
    }

    Role role = roleManager.getEntity(roleName);
    if (role == null) {
      throw new AuthException(
          TSStatusCode.ROLE_NOT_EXIST, String.format(NO_SUCH_ROLE_EXCEPTION, roleName));
    }
    userManager.revokeRoleFromUser(roleName, userName);
  }
Checks if a user has admin privileges
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java