use of javax.jcr.security.NamedAccessControlPolicy in project jackrabbit-oak by apache.
the class CugAccessControlManagerTest method testRemoveInvalidPolicy.
@Test
public void testRemoveInvalidPolicy() throws Exception {
List<AccessControlPolicy> invalidPolicies = ImmutableList.of(new AccessControlPolicy() {
}, new NamedAccessControlPolicy() {
public String getName() {
return "name";
}
}, InvalidCug.INSTANCE);
for (AccessControlPolicy policy : invalidPolicies) {
try {
cugAccessControlManager.removePolicy(SUPPORTED_PATH, policy);
fail("Invalid cug policy must be detected.");
} catch (AccessControlException e) {
// success
}
}
}
use of javax.jcr.security.NamedAccessControlPolicy in project jackrabbit-oak by apache.
the class CugAccessControlManagerTest method testSetInvalidPolicy.
@Test
public void testSetInvalidPolicy() throws Exception {
List<AccessControlPolicy> invalidPolicies = ImmutableList.of(new AccessControlPolicy() {
}, new NamedAccessControlPolicy() {
public String getName() {
return "name";
}
}, InvalidCug.INSTANCE);
for (AccessControlPolicy policy : invalidPolicies) {
try {
cugAccessControlManager.setPolicy(SUPPORTED_PATH, policy);
fail("Invalid cug policy must be detected.");
} catch (AccessControlException e) {
// success
}
}
}
Aggregations