private void validateDirWithAcl(Document doc, Acl acl, String inheritFrom)
throws RepositoryException {
validateNotPublic(doc);
Property usersProperty = doc.findProperty(SpiConstants.PROPNAME_ACLUSERS);
validatePrincipals(acl.getUsers(), usersProperty);
Property groupsProperty = doc.findProperty(SpiConstants.PROPNAME_ACLGROUPS);
validatePrincipals(acl.getGroups(), groupsProperty);
Property denyUsersProperty =
doc.findProperty(SpiConstants.PROPNAME_ACLDENYUSERS);
validatePrincipals(acl.getDenyUsers(), denyUsersProperty);
Property denyGroupsProperty =
doc.findProperty(SpiConstants.PROPNAME_ACLDENYGROUPS);
validatePrincipals(acl.getDenyGroups(), denyGroupsProperty);
Property aclDocumentTypeProperty =
doc.findProperty(SpiConstants.PROPNAME_DOCUMENTTYPE);
assertNotNull(aclDocumentTypeProperty);
assertEquals(SpiConstants.DocumentType.ACL.toString(),
aclDocumentTypeProperty.nextValue().toString());
Property aclInheritanceTypeProperty =
doc.findProperty(SpiConstants.PROPNAME_ACLINHERITANCETYPE);
assertNotNull(aclInheritanceTypeProperty);
assertEquals(SpiConstants.AclInheritanceType.CHILD_OVERRIDES.toString(),
aclInheritanceTypeProperty.nextValue().toString());
Property aclInheritFrom = doc.findProperty(
SpiConstants.PROPNAME_ACLINHERITFROM_DOCID);
assertNotNull(aclInheritFrom);
assertEquals(inheritFrom, aclInheritFrom.nextValue().toString());
}