Page MenuHomePhabricator

[lib] Replace `innerThreadFrozenDueToBlock` with `threadIsWithBlockedUserOnlyWithoutAdminRoleCheck` in `useThreadsWithPermission`
ClosedPublic

Authored by atul on Mon, Jun 3, 1:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 21, 6:23 AM
Unknown Object (File)
Fri, Jun 21, 6:23 AM
Unknown Object (File)
Thu, Jun 20, 6:26 AM
Unknown Object (File)
Thu, Jun 20, 4:55 AM
Unknown Object (File)
Fri, Jun 14, 11:59 PM
Unknown Object (File)
Fri, Jun 14, 5:25 PM
Unknown Object (File)
Mon, Jun 10, 5:02 AM
Unknown Object (File)
Mon, Jun 10, 4:59 AM
Subscribers
None

Details

Summary

This allows us to narrow things as threadIsWithBlockedUserOnlyWithoutAdminRoleCheck only accepts ThreadInfo and will help us remove ThreadInfo from memberHasAdminPowers.memberInfo argument without that invariant.


Depends on D12289

Test Plan

flow + close reading

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Mon, Jun 3, 1:27 PM
atul added inline comments.
lib/shared/thread-utils.js
179 ↗(On Diff #40899)

What was set to true here was skipMemberAdminRoleCheck option. The checkOnlyViewerBlock option was set within innerThreadFrozenDueToBlock.

179 ↗(On Diff #40899)

What is set to false here is the checkOnlyViewerBlock option, there's no skipMemberAdminRoleCheck option when calling threadIsWithBlockedUserOnlyWithoutAdminRoleCheck because the whole point is that we only accept ThreadInfo and handle admin role check separately.

tomek added inline comments.
lib/shared/thread-utils.js
179 ↗(On Diff #40899)

Can we introduce an object param instead of multiple params with an unobvious meaning?

This revision is now accepted and ready to land.Tue, Jun 4, 1:51 AM
lib/shared/thread-utils.js
179 ↗(On Diff #40899)

We actually introduced and un-introduced object param in this stack, there's just one option now.

This revision was landed with ongoing or failed builds.Sun, Jun 16, 5:35 PM
This revision was automatically updated to reflect the committed changes.