Page MenuHomePhabricator

[lib] Remove usage of `memberHasAdminPowers` in `useThreadSearchIndex`
ClosedPublic

Authored by atul on Mar 7 2024, 9:32 AM.
Tags
None
Referenced Files
F3527839: D11276.id38233.diff
Tue, Dec 24, 6:55 AM
F3527838: D11276.id38234.diff
Tue, Dec 24, 6:55 AM
F3527837: D11276.id37936.diff
Tue, Dec 24, 6:55 AM
F3527825: D11276.id.diff
Tue, Dec 24, 6:54 AM
F3527818: D11276.diff
Tue, Dec 24, 6:54 AM
F3526690: D11276.diff
Tue, Dec 24, 12:56 AM
Unknown Object (File)
Fri, Dec 13, 10:39 AM
Unknown Object (File)
Mon, Dec 9, 11:46 AM
Subscribers

Details

Summary

As part of https://linear.app/comm/issue/ENG-6933/update-memberhasadminpower-logic-to-rely-on-specialrole-field, we're going to update memberHasAdminPowers so it determines whether a member is an admin not based on derived permissions, but whether they have an admin role in the community thread.

This will require us to change the signature of memberHasAdminPowers to include additional info (eg ThreadInfo). Before making that change, I wanted to go through all of the usages of memberHasAdminPowers to see how things would need to change at the callsite.

With useThreadSearchIndex, it was more efficient to calculate a map inline of communityThreadID -> memberID -> RoleInfo once and query that multidimensional dictionary rather than call a modified memberHasAdminPowers with communityThreadInfo and threadInfo.


Depends on D11263

Test Plan
  1. Able to log that the dictionary was constructed properly:
  1. Able to log that the computed isAdmin values were as expected:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable