code: private String[] getPermissions(HierarchicalProperty property)
     {
        Set<String> permissionsToBeChanged = new HashSet<String>();
  
        // grant|deny element must have at least one privilege element
        // <!ELEMENT grant (privilege+)> 
        // <!ELEMENT deny (privilege+)> 
        if (property.getChildren().size() == 0)
        {
           throw new IllegalArgumentException("Malformed grant|deny element (seems that no privilige is specified)");
        }
  
        for (HierarchicalProperty propertyRunner : property.getChildren())
        {
           HierarchicalProperty permissionProperty;
  
           // obviously privilege must be single named
           // <!ELEMENT privilege ANY>
           if (ACLProperties.PRIVILEGE.equals(propertyRunner.getName()))
           {
              if (propertyRunner.getChildren().size() > 1)
              {
                 throw new IllegalArgumentException(
                    "Malformed privilege name (element privilege must contain only one element)");
              }
              permissionProperty = propertyRunner.getChild(0);
           }
           else
           {
              permissionProperty = propertyRunner;
           }
  
           if (ACLProperties.READ.equals(permissionProperty.getName()))
           {
              permissionsToBeChanged.add(PermissionType.READ);
  
           }
           else if (ACLProperties.WRITE.equals(permissionProperty.getName()))
           {
              permissionsToBeChanged.add(PermissionType.ADD_NODE);
              permissionsToBeChanged.add(PermissionType.SET_PROPERTY);
              permissionsToBeChanged.add(PermissionType.REMOVE);
  
           }
           else if (ACLProperties.ALL.equals(permissionProperty.getName()))
           {
              permissionsToBeChanged.add(PermissionType.READ);
              permissionsToBeChanged.add(PermissionType.ADD_NODE);
              permissionsToBeChanged.add(PermissionType.SET_PROPERTY);
              permissionsToBeChanged.add(PermissionType.REMOVE);
           }
           // in case privilege with specified name is unsupported
           // or simply incorrect privilege name
           else
           {
              throw new IllegalArgumentException("Malformed privilege element (unsupported privilege name)");
           }
        }
        return permissionsToBeChanged.toArray(new String[0]);
        
     }
docs: Processes {@link HierarchicalProperty} instance, representing grant or deny
  element of ACL request body, to pull out permissions set represented as {@link String} array.
  @param property
  @return String[] - permissions set