@PreAuthorize("hasRole('ROLE_ADMIN')") @Transactional(readOnly = true) public ResultClass<User> getAll() { ResultClass<User> result = new ResultClass<>(); result.addAll(repositoryUser.getAllUsers()); return result; }
@PreAuthorize("hasRole('ROLE_ADMIN')") @Transactional(readOnly = true) public void downloadCSV(HttpServletResponse response) throws IOException { Collection<User> users = new ArrayList<User>(); users = repositoryUser.getAllUsers(); if (!users.isEmpty()) { UserCSV userCSV = new UserCSV(); userCSV.downloadCSV(response, users); } }