HomePhabricator
Diffusion Comm 43137cdaa2c0

[lib] Remove usage of `memberHasAdminPowers` in `useKeyserverAdmin`

Tags
None
Referenced Files
F1415514: 6957eb.png
Mar 18 2024, 12:47 PM
File Not Attached
Subscribers
None

Description

[lib] Remove usage of memberHasAdminPowers in useKeyserverAdmin

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 useKeyserverAdmin, there's really no need to use memberHasAdminPowers since we're dealing with a community thread and can just look for member that has admin role directly. There's no real benefit to using memberHasAdminPowers or a similar utility here, so opted to just use roleHasAdminRole directly on each member role.


Depends on D11262

Test Plan:

6957eb.png (1×1 px, 1 MB)

Made sure that keyserver admin appeared as expected before the change (navigating to thread settings on native app + logging): (left)
Made sure that keyserver admin appeared as expected after the change: (right)

Reviewers: ginsu, tomek, michal, kamil

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D11263

Details

Provenance
atulAuthored on Mar 18 2024, 11:44 AM
Reviewer
tomek
Differential Revision
D11263: [lib] Remove usage of `memberHasAdminPowers` in `useKeyserverAdmin`
Parents
rCOMM64e88bdfce59: Revert "[native] Temporary changes for staff release"
Branches
Unknown
Tags
Unknown