@Override
  public TPermissionInfoResp checkUserPrivileges(TCheckUserPrivilegesReq req) {
    PrivilegeModelType reqType = PrivilegeModelType.values()[req.getReqtype()];
    PrivilegeType permission;
    // permission = -1. check object's visible.
    if (req.getPermission() == -1) {
      permission = null;
    } else {
      permission = PrivilegeType.values()[req.getPermission()];
    }
    switch (reqType) {
      case TREE:
        List<PartialPath> partialPaths =
            AuthUtils.deserializePartialPathList(ByteBuffer.wrap(req.getPaths()));
        return configManager.checkUserPrivileges(
            req.getUsername(), new PrivilegeUnion(partialPaths, permission, req.isGrantOpt()));
      case SYSTEM:
        return configManager.checkUserPrivileges(
            req.getUsername(), new PrivilegeUnion(permission, req.isGrantOpt()));
      case RELATIONAL:
        PrivilegeUnion union;
        if (!req.isSetDatabase() && !req.isSetTable()) {
          union = new PrivilegeUnion(permission, req.isGrantOpt(), true);
        } else if (req.isSetTable()) {
          union =
              new PrivilegeUnion(req.getDatabase(), req.getTable(), permission, req.isGrantOpt());
        } else {
          union = new PrivilegeUnion(req.getDatabase(), permission, req.isGrantOpt());
        }
        return configManager.checkUserPrivileges(req.getUsername(), union);
      default:
        return AuthUtils.generateEmptyPermissionInfoResp();
    }
  }
ConfigNodeRPCServer exposes the interface that interacts with the DataNode
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java