// load the entries:
AccessControlManager acMgr = sImpl.getAccessControlManager();
NodeIterator itr = aclNode.getNodes();
while (itr.hasNext()) {
NodeImpl aceNode = (NodeImpl) itr.nextNode();
try {
String principalName = aceNode.getProperty(AccessControlConstants.P_PRINCIPAL_NAME).getString();
Principal princ = principalMgr.getPrincipal(principalName);
if (princ == null) {
log.debug("Principal with name " + principalName + " unknown to PrincipalManager.");
princ = new PrincipalImpl(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,
aceNode.isNodeType(AccessControlConstants.NT_REP_GRANT_ACE),
valueFactory);
// add the entry
internalAdd(ace);
} catch (RepositoryException e) {
log.debug("Failed to build ACE from content.", e.getMessage());