From 0c3f59fd688a5488cadfb9286d11fbedff766d5d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 4 Sep 2019 07:09:39 -0700 Subject: [PATCH] (stable) Update a straggling "getAuthorities()" call in Fund Summary: Ref T13366. The "authorities" mechanism was replaced, but I missed this callsite. Update it to use the request cache mechanism. Test Plan: As a user without permission to view some initiatives, viewed a list of initiatives. Maniphest Tasks: T13366 Differential Revision: https://secure.phabricator.com/D20783 --- src/applications/fund/storage/FundInitiative.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/applications/fund/storage/FundInitiative.php b/src/applications/fund/storage/FundInitiative.php index 5e4dd48026..1ebbb35ef1 100644 --- a/src/applications/fund/storage/FundInitiative.php +++ b/src/applications/fund/storage/FundInitiative.php @@ -136,12 +136,12 @@ final class FundInitiative extends FundDAO } if ($capability == PhabricatorPolicyCapability::CAN_VIEW) { - foreach ($viewer->getAuthorities() as $authority) { - if ($authority instanceof PhortuneMerchant) { - if ($authority->getPHID() == $this->getMerchantPHID()) { - return true; - } - } + $can_merchant = PhortuneMerchantQuery::canViewersEditMerchants( + array($viewer->getPHID()), + array($this->getMerchantPHID())); + + if ($can_merchant) { + return true; } }