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:
parent
05510aa41f
commit
85cc15b56d
1 changed files with 15 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue