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)
Sat, Dec 28, 5:54 PM
Unknown Object (File)
Sat, Dec 28, 5:54 PM
Unknown Object (File)
Sat, Dec 28, 5:53 PM
Unknown Object (File)
Sat, Dec 28, 5:42 PM
Unknown Object (File)
Thu, Dec 26, 12:38 AM
Unknown Object (File)
Mon, Dec 23, 5:59 AM
Unknown Object (File)
Wed, Dec 18, 1:50 PM
Unknown Object (File)
Dec 5 2024, 12:08 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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

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

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