@Deprecated public void deleteEntity(EntityReference ref, Map<String, Object> params) { String id = ref.getId(); String userReference = developerHelperService.getCurrentUserReference(); if (userReference == null) { throw new EntityException( "Anonymous user cannot delete option", ref.getId(), HttpServletResponse.SC_UNAUTHORIZED); } Option option = getOptionById(id); if (option == null) { throw new IllegalArgumentException( "No option found to delete for the given reference: " + ref); } checkOptionPermission(userReference, option); pollListManager.deleteOption(option); }