} // else: no-node at all or no acl-node present.
}
AccessControlEntry createEntry(Principal princ, Privilege[] privileges, boolean allow, Map restrictions) throws RepositoryException {
if (!principal.equals(princ)) {
throw new AccessControlException("Invalid principal. Expected: " + principal);
}
if (!allow && principal instanceof Group) {
throw new AccessControlException("For group principals permissions can only be added but not denied.");
}
Set rNames = restrictions.keySet();
if (!rNames.contains(jcrNodePathName)) {
throw new AccessControlException("Missing mandatory restriction: " + jcrNodePathName);
}
// make sure the nodePath restriction is of type PATH
Value v = (Value) restrictions.get(jcrNodePathName);
if (v.getType() != PropertyType.PATH) {