[native] Introduce recursivelyUpdatePermissions(ThreadTraversalNode)
Summary:
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
Test Plan:
Ran with correct threadStore from keyserver (devDB) and ensured that it remained the same.
Also removed all member.permissions from threadStore and ensured that recursivelyUpdatePermissions was able to compute all member.permissions "from scratch" (AKA not depending on any existing member.permissions. There are unit tests for this included in the diff.
Reviewers: ashoat, ginsu
Reviewed By: ashoat
Subscribers: tomek, ashoat
Differential Revision: https://phab.comm.dev/D7602