Page MenuHomePhabricator

[lib] Update `threadHasPermission` to "go through" `permissionLookup`
ClosedPublic

Authored by atul on Nov 13 2023, 1:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 1:50 PM
Unknown Object (File)
Thu, Dec 5, 12:08 AM
Unknown Object (File)
Wed, Dec 4, 1:16 PM
Unknown Object (File)
Nov 16 2024, 8:43 PM
Unknown Object (File)
Nov 16 2024, 8:43 PM
Unknown Object (File)
Nov 16 2024, 8:43 PM
Unknown Object (File)
Nov 16 2024, 8:38 PM
Unknown Object (File)
Oct 22 2024, 3:00 AM
Subscribers
None

Details

Summary

Update threadHasPermission to "go through" permissionLookup for checking permissions rather than indexing into threadInfo.currentUser.permission directly.
This ensures that behavior of threadHasPermission matches permissionLookup. Specifically, to ensure that the KNOW_OF permission is also true in addition to whatever permission is being checked. This will also ensure that in the future we only need to add conditions in "one place."


Depends on D9844

Test Plan

Close reading/flow, don't think we need a unit test for this...

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Nov 13 2023, 1:04 PM
atul added inline comments.
lib/shared/thread-utils.js
135–137 ↗(On Diff #33147)

This case is handled within permissionLookup so removing duplicate logic (even though I guess it would "short circuit" a function call).

Thanks for identifying / fixing this

This revision is now accepted and ready to land.Nov 13 2023, 2:00 PM