Set<GeoServerUserGroup> orig = ugStore.getGroupsForUser(user);
Set<GeoServerUserGroup> add = new HashSet<GeoServerUserGroup>();
Set<GeoServerUserGroup> remove = new HashSet<GeoServerUserGroup>();
userGroupPalette.diff(orig, add, remove);
ugStore.updateUser(user);
for (GeoServerUserGroup g : add) ugStore.associateUserToGroup(user, g);
for (GeoServerUserGroup g : remove) ugStore.disAssociateUserFromGroup(user,g);
ugStore.store();