Changeset View
Changeset View
Standalone View
Standalone View
src/applications/fund/storage/FundBacker.php
| Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
| /* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getCapabilities() { | public function getCapabilities() { | ||||
| return array( | return array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| PhabricatorPolicyCapability::CAN_EDIT, | |||||
| ); | ); | ||||
| } | } | ||||
| public function getPolicy($capability) { | public function getPolicy($capability) { | ||||
| switch ($capability) { | switch ($capability) { | ||||
| case PhabricatorPolicyCapability::CAN_VIEW: | case PhabricatorPolicyCapability::CAN_VIEW: | ||||
| // If we have the initiative, use the initiative's policy. | // If we have the initiative, use the initiative's policy. | ||||
| // Otherwise, return NOONE. This allows the backer to continue seeing | // Otherwise, return NOONE. This allows the backer to continue seeing | ||||
| // a backer even if they're no longer allowed to see the initiative. | // a backer even if they're no longer allowed to see the initiative. | ||||
| $initiative = $this->getInitiative(); | $initiative = $this->getInitiative(); | ||||
| if ($initiative) { | if ($initiative) { | ||||
| return $initiative->getPolicy($capability); | return $initiative->getPolicy($capability); | ||||
| } | } | ||||
| return PhabricatorPolicies::POLICY_NOONE; | return PhabricatorPolicies::POLICY_NOONE; | ||||
| case PhabricatorPolicyCapability::CAN_EDIT: | |||||
| return PhabricatorPolicies::POLICY_NOONE; | |||||
epriestley: This is a fix for Fund after T13186, since this policy is now checked explicitly in more places. | |||||
| } | } | ||||
| } | } | ||||
| public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
| return ($viewer->getPHID() == $this->getBackerPHID()); | return ($viewer->getPHID() == $this->getBackerPHID()); | ||||
| } | } | ||||
| public function describeAutomaticCapability($capability) { | public function describeAutomaticCapability($capability) { | ||||
| Show All 16 Lines | |||||
This is a fix for Fund after T13186, since this policy is now checked explicitly in more places.