logger.debug("Sharing an already shared folder '{}' with friend '{}'.",
folderIndex.getName(), context.getFriendId());
folderIndex.addUserPermissions(context.getUserPermission());
} else {
// make the node shared with the new protection keys
folderIndex.share(context.consumeNewProtectionKeys());
// add read/write user permission of friend
folderIndex.addUserPermissions(context.getUserPermission());
// add write user permission of user itself
folderIndex.addUserPermissions(new UserPermission(userId, PermissionType.WRITE));
}