We introduce recursivelyUpdatePermissions(ThreadTraversalNode, memberToThreadPermissionsFromParent) which traverses node and all children recursively to update member.permissions.
memberToThreadPermissionsFromParent is a map from userID to permissionsFromParent (?ThreadPermissionsBlob). Each node calculates makePermissionsForChildrenBlob for each member and populates memberToThreadPermissionsFromParent. memberToThreadPermissionsFromParent is then passed in as an argument for recursive call for each child. The child will call makePermissionsBlob with both rolePermissions and permissionsFromParent to compute the aggregate permissions that will be stored in member.permissions.
Depends on D7601