*/
static void collectEntries(NodeImpl aclNode, Map princToEntries)
throws RepositoryException {
SessionImpl sImpl = (SessionImpl) aclNode.getSession();
PrincipalManager principalMgr = sImpl.getPrincipalManager();
AccessControlManager acMgr = sImpl.getAccessControlManager();
NodeIterator itr = aclNode.getNodes();
while (itr.hasNext()) {
NodeImpl aceNode = (NodeImpl) itr.nextNode();
String principalName = aceNode.getProperty(AccessControlConstants.P_PRINCIPAL_NAME).getString();
// only process aceNode if 'principalName' is contained in the given set
if (princToEntries.containsKey(principalName)) {
Principal princ = principalMgr.getPrincipal(principalName);
Value[] privValues = aceNode.getProperty(AccessControlConstants.P_PRIVILEGES).getValues();
Privilege[] privs = new Privilege[privValues.length];
for (int i = 0; i < privValues.length; i++) {
privs[i] = acMgr.privilegeFromName(privValues[i].getString());
}
// create a new ACEImpl (omitting validation check)
Entry ace = new Entry(
princ,
privs,