Page MenuHomePhabricator

[lib] Refactor decodeRolePermissionBitmask to use constructThreadPermissionString
ClosedPublic

Authored by ashoat on Aug 8 2024, 1:23 PM.
Tags
None
Referenced Files
F3323032: D13034.id.diff
Wed, Nov 20, 2:44 AM
Unknown Object (File)
Mon, Nov 11, 9:16 AM
Unknown Object (File)
Oct 14 2024, 7:41 PM
Unknown Object (File)
Oct 14 2024, 7:41 PM
Unknown Object (File)
Oct 14 2024, 7:41 PM
Unknown Object (File)
Oct 14 2024, 7:40 PM
Unknown Object (File)
Oct 14 2024, 12:14 AM
Unknown Object (File)
Oct 13 2024, 6:19 AM
Subscribers
None

Details

Summary

This refactor helps prevent this mistake from happening again in the future.

Depends on D13019

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

lib/permissions/prefixes.js
63 ↗(On Diff #43267)

I snuck this rename in

lib/types/thread-permission-types.js
52–82 ↗(On Diff #43267)

I snuck this rename in

ashoat requested review of this revision.Aug 8 2024, 1:40 PM
This revision is now accepted and ready to land.Aug 9 2024, 2:22 AM