code: public static void checkPermission(String path, LockType type) throws MgmtZooKeeperException {
          if (znodePermission.get() != null) {
              znodePermission.get().checkPermission(path, type);
          }
      }
docs: Clear ZNodePermission of current-thread to null.
  
  If znodePermission.get() returns null, this method skip permission-check. Otherwise, do permission-check.
  <pre>There are two different scenarios.
  1. workflows, commands, watch-event for clusters do permission-check.
  2. leader-election, confmaster-init/release skip permission-check.</pre>
  It is not deterministic that what thread will allocated to the scenarios.
  Call this method not to affect a next thread, after calling addPermission() method.