connObjectUtil.retrieveVirAttrValues(user, AttributableUtil.getInstance(AttributableType.USER));
fillTO(userTO, user.getAttributes(), user.getDerivedAttributes(), user.getVirtualAttributes(),
user.getResources());
MembershipTO membershipTO;
for (Membership membership : user.getMemberships()) {
membershipTO = new MembershipTO();
membershipTO.setId(membership.getId());
membershipTO.setRoleId(membership.getSyncopeRole().getId());
membershipTO.setRoleName(membership.getSyncopeRole().getName());
fillTO(membershipTO, membership.getAttributes(), membership.getDerivedAttributes(), membership.
getVirtualAttributes(), membership.getResources());
userTO.addMembership(membershipTO);