private void checkPermissionForAdd(Session session, String[] paths)
throws RepositoryException, ReplicationRequestAuthorizationException {
AccessControlManager acMgr = session.getAccessControlManager();
Privilege[] privileges = new Privilege[] { acMgr.privilegeFromName(jcrPrivilege), acMgr.privilegeFromName(Privilege.JCR_READ) };
for (String path : paths) {
if(!acMgr.hasPrivileges(path, privileges)) {
throw new ReplicationRequestAuthorizationException("Not enough privileges");
}
}