pt.addEntry(testPrincipal, privs, true, Collections.<String, Value>emptyMap());
assertFalse(pt.addEntry(testPrincipal, privs, true, Collections.<String, Value>emptyMap()));
}
public void testEffect() throws RepositoryException, NotExecutableException {
JackrabbitAccessControlList pt = createEmptyTemplate(getTestPath());
Privilege[] read = privilegesFromName(Privilege.JCR_READ);
Privilege[] modProp = privilegesFromName(Privilege.JCR_MODIFY_PROPERTIES);
pt.addAccessControlEntry(testPrincipal, read);
// add deny entry for mod_props
assertTrue(pt.addEntry(testPrincipal, modProp, false, null));
// test net-effect
int allows = PrivilegeRegistry.NO_PRIVILEGE;
int denies = PrivilegeRegistry.NO_PRIVILEGE;
AccessControlEntry[] entries = pt.getAccessControlEntries();
for (AccessControlEntry ace : entries) {
if (testPrincipal.equals(ace.getPrincipal()) && ace instanceof JackrabbitAccessControlEntry) {
int entryBits = PrivilegeRegistry.getBits(ace.getPrivileges());
if (((JackrabbitAccessControlEntry) ace).isAllow()) {
allows |= Permission.diff(entryBits, denies);