use of com.enonic.xp.security.acl.AccessControlEntry in project xp by enonic.
the class PermissionsFactoryTest method checkAllowed.
private void checkAllowed(final AccessControlList acl, final String principalKey, final Permission... allowed) {
final AccessControlEntry principal = acl.getEntry(PrincipalKey.from(principalKey));
if (principal == null) {
fail("Missing entry for principal [" + principalKey + "]");
}
Arrays.stream(allowed).forEach((entry) -> assertTrue(principal.isAllowed(entry), "Should allow [" + entry + "]"));
}
Aggregations