public static TSStatus getTSStatus(boolean hasPermission, String errMsg) {
    return hasPermission
        ? SUCCEED
        : new TSStatus(TSStatusCode.NO_PERMISSION.getStatusCode()).setMessage(errMsg);
  }
Check whether specific Session has the authorization to given plan.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java