@Override
  public void createRole(String roleName) throws AuthException {
    AuthUtils.validateRolename(roleName);
    if (!roleManager.createRole(roleName)) {
      LOGGER.error("Role {} already exists", roleName);
      throw new AuthException(
          TSStatusCode.ROLE_ALREADY_EXIST, String.format("Role %s already exists", roleName));
    }
  }
Checks if a user has admin privileges
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/authorizer/BasicAuthorizer.java