Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/storage/ManiphestTask.php
Show First 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | /* -( Policy Interface )--------------------------------------------------- */ | ||||
public function getPolicy($capability) { | public function getPolicy($capability) { | ||||
switch ($capability) { | switch ($capability) { | ||||
case PhabricatorPolicyCapability::CAN_VIEW: | case PhabricatorPolicyCapability::CAN_VIEW: | ||||
return $this->getViewPolicy(); | return $this->getViewPolicy(); | ||||
case PhabricatorPolicyCapability::CAN_INTERACT: | case PhabricatorPolicyCapability::CAN_INTERACT: | ||||
if ($this->isLocked()) { | if ($this->isLocked()) { | ||||
return PhabricatorPolicies::POLICY_NOONE; | return PhabricatorPolicies::POLICY_NOONE; | ||||
} else { | } else { | ||||
return PhabricatorPolicies::POLICY_USER; | return $this->getViewPolicy(); | ||||
} | } | ||||
case PhabricatorPolicyCapability::CAN_EDIT: | case PhabricatorPolicyCapability::CAN_EDIT: | ||||
return $this->getEditPolicy(); | return $this->getEditPolicy(); | ||||
} | } | ||||
} | } | ||||
public function hasAutomaticCapability($capability, PhabricatorUser $user) { | public function hasAutomaticCapability($capability, PhabricatorUser $user) { | ||||
// The owner of a task can always view and edit it. | // The owner of a task can always view and edit it. | ||||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |