}
private ACLTemplate getPolicy(AccessControlManager acM, String path, Principal principal) throws RepositoryException,
AccessDeniedException, NotExecutableException {
// try applicable (new) ACLs first
AccessControlPolicyIterator itr = acM.getApplicablePolicies(path);
while (itr.hasNext()) {
AccessControlPolicy policy = itr.nextAccessControlPolicy();
if (policy instanceof ACLTemplate) {
return (ACLTemplate) policy;
}
}
// try if there is an acl that has been set before: