Page MenuHomePhabricator

[lib] Don't clear member_ prefix when propagating permissions to children
ClosedPublic

Authored by ashoat on Aug 7 2024, 1:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 14, 7:41 PM
Unknown Object (File)
Mon, Oct 14, 7:41 PM
Unknown Object (File)
Mon, Oct 14, 7:41 PM
Unknown Object (File)
Mon, Oct 14, 7:40 PM
Unknown Object (File)
Sep 20 2024, 1:45 AM
Unknown Object (File)
Sep 19 2024, 10:56 PM
Unknown Object (File)
Sep 16 2024, 8:18 AM
Unknown Object (File)
Sep 15 2024, 3:51 PM
Subscribers
None

Details

Summary

We had some hacky code in makePermissionsForChildrenBlob that was intended to strip the propagation prefix.

At the time it was written, there were only two prefixes, so it was easy to strip the propagation prefix by just constructing a new permissions string using only the filter prefix.

Now that we have three prefixes, it makes sense to do this in a more idiomatic way. This diff introduces constructThreadPermissionString, the inverse of parseThreadPermissionString. It allows us to construct a new permissions string based on a ParsedThreadPermissionString where we have cleared the `propagationPrefix.

Depends on D13015

Test Plan

The whole stack was tested as follows:

  1. Unit tests from D9686, which toggle user-surfaced permissions on and off and make sure no difference is caught. This ensures that the original issue introduced in D9686 isn't reintroduced
  2. Careful review of each descendant permission removed in D9686
  3. Create a community as userA and add userB. Grant tagging permissions to all members. Make sure userB can tag inside non-root channels
  4. Do above, then create a channel without userB, and make sure userB can't tag there either (or do anything other than view). This is the repro described here
  5. Do above, but also create a thread inside the channel (as userA) and make sure userB can't do anything inside the thread other than view, until they join the parent channel

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Aug 7 2024, 1:48 PM
Harbormaster failed remote builds in B30988: Diff 43233!
ashoat requested review of this revision.Aug 7 2024, 1:48 PM
This revision is now accepted and ready to land.Aug 8 2024, 3:19 AM
This revision was landed with ongoing or failed builds.Aug 9 2024, 7:28 PM
This revision was automatically updated to reflect the committed changes.