JsonNode privateAttributes, JsonNode friendsAttributes,
JsonNode appUsersAttributes) throws Exception{
if (nonAppUserAttributes!=null) {
ODocument attrObj = profile.field(UserDao.ATTRIBUTES_VISIBLE_BY_ANONYMOUS_USER);
if (attrObj==null) attrObj=new ODocument(UserDao.USER_ATTRIBUTES_CLASS);
attrObj.fromJSON(nonAppUserAttributes.toString());
PermissionsHelper.grantRead(attrObj, RoleDao.getRole(DefaultRoles.REGISTERED_USER.toString()));
PermissionsHelper.grantRead(attrObj, RoleDao.getRole(DefaultRoles.ANONYMOUS_USER.toString()));
PermissionsHelper.grantRead(attrObj, RoleDao.getFriendRole());
profile.field(UserDao.ATTRIBUTES_VISIBLE_BY_ANONYMOUS_USER,attrObj);
attrObj.save();