public static Permission parse(String permission) {
      int permissionCode = 0;
      for (char each : permission.toLowerCase().toCharArray()) {
        switch (each) {
          case 'r': permissionCode |= ZooDefs.Perms.READ; break;
          case 'w': permissionCode |= ZooDefs.Perms.WRITE; break;
          case 'c': permissionCode |= ZooDefs.Perms.CREATE; break;
          case 'd': permissionCode |= ZooDefs.Perms.DELETE; break;
          case 'a': permissionCode |= ZooDefs.Perms.ADMIN; break;
          default: throw new IllegalArgumentException("Unsupported permission: " + permission);
        }
      }
      return new Permission(permissionCode);
    }
Sets the ACL on the znode indicated by the given pattern
ambari-agent/src/main/java/org/apache/ambari/tools/zk/ZkAcl.java