code: public static HierarchicalProperty getACL(NodeImpl node) throws RepositoryException
     {
        HierarchicalProperty property = new HierarchicalProperty(ACL);
  
        AccessControlList acl = node.getACL();
  
        HashMap<String, List<String>> principals = new HashMap<String, List<String>>();
  
        List<AccessControlEntry> entryList = acl.getPermissionEntries();
        for (AccessControlEntry entry : entryList)
        {
           String principal = entry.getIdentity();
           String grant = entry.getPermission();
  
           List<String> grantList = principals.get(principal);
           if (grantList == null)
           {
              grantList = new ArrayList<String>();
              principals.put(principal, grantList);
           }
  
           grantList.add(grant);
        }
  
        Iterator<String> principalIter = principals.keySet().iterator();
        while (principalIter.hasNext())
        {
           HierarchicalProperty aceProperty = new HierarchicalProperty(ACE);
  
           String curPrincipal = principalIter.next();
  
           aceProperty.addChild(getPrincipalProperty(curPrincipal));
  
           aceProperty.addChild(getGrantProperty(principals.get(curPrincipal)));
  
           property.addChild(aceProperty);
        }
  
        return property;
     }
docs: Gets {@link AccessControlList} and transform it to DAV:acl property view
  represented by a {@link HierarchicalProperty} instance.
  @param node - {@link NodeImpl} from which we are to get an ACL
  @return HierarchicalProperty - tree like structure corresponding to an DAV:acl property
  @throws RepositoryException