@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Recognize merchant authority in Fund initiatives

Summary: Update fund for new merchant authority stuff.

Test Plan:
- Created a secret initiative.
- Could see related activity as merchant.
- Could not see it not-as-merchant.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11959

+15 -1
+15 -1
src/applications/fund/storage/FundInitiative.php
··· 125 125 } 126 126 127 127 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { 128 - return ($viewer->getPHID() == $this->getOwnerPHID()); 128 + if ($viewer->getPHID() == $this->getOwnerPHID()) { 129 + return true; 130 + } 131 + 132 + if ($capability == PhabricatorPolicyCapability::CAN_VIEW) { 133 + foreach ($viewer->getAuthorities() as $authority) { 134 + if ($authority instanceof PhortuneMerchant) { 135 + if ($authority->getPHID() == $this->getMerchantPHID()) { 136 + return true; 137 + } 138 + } 139 + } 140 + } 141 + 142 + return false; 129 143 } 130 144 131 145 public function describeAutomaticCapability($capability) {