Page MenuHomePhabricator

[lib] Introduce `threadPermissionsFromBitmaskHex`
ClosedPublic

Authored by atul on Nov 7 2023, 10:53 AM.
Tags
None
Referenced Files
F3655852: D9752.id32927.diff
Sun, Jan 5, 12:07 PM
F3655851: D9752.id32926.diff
Sun, Jan 5, 12:07 PM
F3655850: D9752.id32917.diff
Sun, Jan 5, 12:07 PM
F3655782: D9752.diff
Sun, Jan 5, 12:03 PM
Unknown Object (File)
Sat, Jan 4, 7:50 PM
Unknown Object (File)
Thu, Jan 2, 2:41 AM
Unknown Object (File)
Sun, Dec 22, 10:45 PM
Unknown Object (File)
Sat, Dec 21, 4:08 PM
Subscribers

Details

Summary

This function will allow us to go from permissionBitmaskHex "back" to ThreadPermissionsInfo.

NOTE: Once we've made all the necessary changes on native we'll be able to remove this function altogether and use hasPermission(permissionsBitmaskHex:string, permission:ThreadPermission) instead. This is for incremental step where we send encoded permissions to native and web clients and IMMEDIATELY decode back to ThreadPermissionsInfo and ThreadRolePermissionsBlob. The diffs immediately after that will handle refactoring clients so we can "query" the minimal encoding directly.

Next diffs:

  • Higher level utilities for translating back/forth from RawThreadInfo <=> MinimallyEncodedRawThreadInfo
  • Native refactoring + migrations
  • Web refactoring
  • Flipping the switch
Test Plan

Unit test

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/permissions/minimally-encoded-thread-permissions.js
110–112 ↗(On Diff #32917)

Ignore the sources being set here, they're ignored anyways.

This function will be removed altogether shortly once we update clients to "query" bitmask directly via hasPermission(...) function (right below).

This is really to keep things working in intermediate state for convenience.

atul published this revision for review.Nov 7 2023, 10:56 AM
This revision is now accepted and ready to land.Nov 7 2023, 11:10 AM
This revision was landed with ongoing or failed builds.Nov 7 2023, 12:18 PM
This revision was automatically updated to reflect the committed changes.