}
}
private void checkValidEntry() throws AccessControlException, NamespaceException {
if (!principal.equals(getPrincipal())) {
throw new AccessControlException("Invalid principal. Expected: " + principal);
}
if (!isAllow() && getPrincipal() instanceof Group) {
throw new AccessControlException("For group principals permissions can only be added but not denied.");
}
String[] rNames = getRestrictionNames();
if (!Arrays.asList(rNames).contains(jcrNodePathName)) {
throw new AccessControlException("Missing mandatory restriction: " + jcrNodePathName);
}
}