1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 21:32:43 +01:00

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
This commit is contained in:
epriestley 2015-03-04 10:35:53 -08:00
parent 05510aa41f
commit 85cc15b56d

View file

@ -125,7 +125,21 @@ final class FundInitiative extends FundDAO
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
return ($viewer->getPHID() == $this->getOwnerPHID());
if ($viewer->getPHID() == $this->getOwnerPHID()) {
return true;
}
if ($capability == PhabricatorPolicyCapability::CAN_VIEW) {
foreach ($viewer->getAuthorities() as $authority) {
if ($authority instanceof PhortuneMerchant) {
if ($authority->getPHID() == $this->getMerchantPHID()) {
return true;
}
}
}
}
return false;
}
public function describeAutomaticCapability($capability) {