private Set<Role> redefineRoles() { Set<Role> userRoles = new HashSet<Role>(userToUpdate.getRoles()); for (String newRole : roleDefinitions.getSource()) { Role role = registrationDao.findRoleByRoleName(newRole); userRoles.remove(role); } for (String newRole : roleDefinitions.getTarget()) { Role role = registrationDao.findRoleByRoleName(newRole); userRoles.add(role); } return userRoles; }
private Set<Role> defineRoles() { Set<Role> userRoles = new HashSet<Role>(); for (String newRole : roleDefinitions.getTarget()) { Role role = registrationDao.findRoleByRoleName(newRole); userRoles.add(role); } return userRoles; }