@Override
  public void revokeAllPrivilegeFromUser(String userName) throws AuthException {
    checkAdmin(userName, "Invalid operation, administrator cannot revoke privileges");
    User user = userManager.getEntity(userName);
    if (user == null) {
      throw new AuthException(
          TSStatusCode.USER_NOT_EXIST, String.format("User %s does not exist", userName));
    }
    user.revokeAllRelationalPrivileges();
  }
Checks if a user has admin privileges
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java