/** * Checks if the user have permissions to remove all of the requested entities. * * @param removeInstances entities to remove * @return true - if the user can remove all of the requested entities, false - * if he don't have permissions to remove at least one of the entities. */ private boolean removePermitted(Collection removeInstances) { for (Object removeInstance : removeInstances) { Entity next = (Entity) removeInstance; if (!removePermitted(next.getMetaClass())) return false; } return true; }
if (!removePermitted(removeInstances)) { response.sendError(HttpServletResponse.SC_FORBIDDEN); return;