Changeset View
Changeset View
Standalone View
Standalone View
src/applications/fund/storage/FundInitiative.php
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
} | } | ||||
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
if ($viewer->getPHID() == $this->getOwnerPHID()) { | if ($viewer->getPHID() == $this->getOwnerPHID()) { | ||||
return true; | return true; | ||||
} | } | ||||
if ($capability == PhabricatorPolicyCapability::CAN_VIEW) { | if ($capability == PhabricatorPolicyCapability::CAN_VIEW) { | ||||
foreach ($viewer->getAuthorities() as $authority) { | $can_merchant = PhortuneMerchantQuery::canViewersEditMerchants( | ||||
if ($authority instanceof PhortuneMerchant) { | array($viewer->getPHID()), | ||||
if ($authority->getPHID() == $this->getMerchantPHID()) { | array($this->getMerchantPHID())); | ||||
if ($can_merchant) { | |||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
} | |||||
} | |||||
return false; | return false; | ||||
} | } | ||||
public function describeAutomaticCapability($capability) { | public function describeAutomaticCapability($capability) { | ||||
return pht('The owner of an initiative can always view and edit it.'); | return pht('The owner of an initiative can always view and edit it.'); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |