JsonNode privateAttributes, JsonNode friendsAttributes,
JsonNode appUsersAttributes) throws InvalidJsonException,Exception{
try{
ORole newORole=RoleDao.getRole(role);
if (newORole==null) throw new InvalidParameterException(role + " is not a role");
if (!RoleService.isAssignable(newORole)) throw new RoleIsNotAssignableException("Role " + role + " is not assignable");
ORID newRole=newORole.getDocument().getIdentity();
UserDao udao=UserDao.getInstance();
ODocument profile=udao.getByUserName(username);
if (profile==null) throw new InvalidParameterException(username + " is not a user");
profile=updateProfile(profile, nonAppUserAttributes,