- Currently, getCurrentUser handles mutating currentUser.permissions if threadFrozenDueToBlock(...) is true.
- The current threadFrozenDueToBlock(...) logic depends on memberHasAdminPowers which depends on sketchy CHANGE_ROLE check.
- We want to update memberHasAdminPowers to instead determine whether member is admin based on whether they have ADMIN_ROLE in community thread.
- Determining whether a member has ADMIN_ROLE in community thread is straightforward from React context, but not practical from non-React context.
- As a result, we want to move threadFrozenDueToBlock from getCurrentUser to useThreadHasPermission where we can compute derived permissions "on demand" from React context.
- As part of that, we're going to update threadHasPermission callsites ON CLIENT (ThreadInfo only) to use useThreadHasPermission.
- Once we've refactored all callsites to be able to use useThreadHasPermission, we will update it to use an updated version of threadFrozenDueToBlock which looks at community thread to determine ADMIN_ROLE using specialRole vs. sketchy CHANGE_ROLE check.
This diff introduces a "hook version" of threadHasPermission that can be used throughout client components. It only handles ThreadInfo and handles filtering of disabled permissions using threadFrozenDueToBlock check.
The next diffs in the stack aim to update all client permission checks to use this hook so we can remove the permission mutation logic from getCurrentUser.
Depends on D11742