HomePhabricator
Diffusion Comm a9069cb74360

[lib] Narrow `threadHasPermission` so it only accepts…

Description

[lib] Narrow threadHasPermission so it only accepts ThreadPermissionNotAffectedByBlock

Summary:
We want permissions which can be disabled by block to go through useThreadHasPermission which calls useThreadsWithPermission which potentially filters out disabled permissions if threadFrozenDueToBlock is true.

However, this additional logic isn't necessary for permissions unaffected by block.

This change gives us confidence that permissions that can be affected by block are "going through" useThreadHasPermission and permission checks going forward where permission may be affected by block won't go through threadHasPermission.

This change also gives us the confidence to unblock D12158 since we know that permission checks for permissions that may be affected by block are being handled via useThreadHasPermission, which means we can avoid potentially filtering out permissions when permissions for ThreadInfo are set in getCurrentUser.


Depends on D12245

Test Plan: flow

Reviewers: ashoat, ginsu, tomek, varun

Reviewed By: ashoat

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