@Test public void testPrivilegesToComparableSet() throws RepositoryException { assertFalse(accessControlManager.privilegeFromName("jcr:removeNode").isAggregate()); assertFalse(accessControlManager.privilegeFromName("jcr:lockManagement").isAggregate()); assertTrue(accessControlManager.privilegeFromName("jcr:read").isAggregate()); assertEquals("simple non-aggregate must equal", "[jcr:lockManagement]", createComparablePrivSet("jcr:lockManagement")); assertEquals("simple aggregate must be resolved to non-aggregates", "[jcr:readNodes, jcr:readProperties]", createComparablePrivSet("jcr:read")); assertEquals("non-aggregate order is sorted (test order un-changed)", "[jcr:lockManagement, jcr:removeNode]", createComparablePrivSet("jcr:lockManagement, jcr:removeNode")); assertEquals("non-aggregate order is sorted (test order changed)", "[jcr:lockManagement, jcr:removeNode]", createComparablePrivSet("jcr:removeNode, jcr:lockManagement")); assertEquals("privilege order not important even for mix of aggregate and non-aggregate privs (must be still equal)", "[jcr:lockManagement, jcr:readNodes, jcr:readProperties, jcr:removeNode]", createComparablePrivSet("jcr:removeNode, jcr:read, jcr:lockManagement")); }
String privilegesToComparableSet(String[] privileges, AccessControlManager acMgr) throws RepositoryException { return new TreeSet<String>(flatSetResolvedAggregates(privileges, acMgr, false)).toString(); }
AceBeanInstallerIncremental extends BaseAceBeanInstaller implements AceBeanInstaller { String privilegesToComparableSet(String[] privileges, AccessControlManager acMgr) throws RepositoryException { return new TreeSet<String>(flatSetResolvedAggregates(privileges, acMgr, false)).toString(); } }
AceBeanInstallerIncremental extends BaseAceBeanInstaller implements AceBeanInstaller { String privilegesToComparableSet(String[] privileges, AccessControlManager acMgr) throws RepositoryException { return new TreeSet<String>(flatSetResolvedAggregates(privileges, acMgr, false)).toString(); }  }
AceBeanInstallerIncremental extends BaseAceBeanInstaller implements AceBeanInstaller { String privilegesToComparableSet(String[] privileges, AccessControlManager acMgr) throws RepositoryException { return new TreeSet<String>(flatSetResolvedAggregates(privileges, acMgr, false)).toString(); }   }
AceBeanInstallerIncremental extends BaseAceBeanInstaller implements AceBeanInstaller { String privilegesToComparableSet(String[] privileges, AccessControlManager acMgr) throws RepositoryException { return new TreeSet<String>(flatSetResolvedAggregates(privileges, acMgr, false)).toString(); }    }