AccessControlManager acMgr = session.getAccessControlManager();
Privilege[] privileges = new Privilege[] { acMgr.privilegeFromName(jcrPrivilege), acMgr.privilegeFromName(Privilege.JCR_REMOVE_NODE) };
for (String path : paths) {
if(session.nodeExists(path) && !acMgr.hasPrivileges(path, privileges)) {
throw new ReplicationRequestAuthorizationException("Not enough privileges");
}
}
}