Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/storage/PhamePost.php
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | public function getPolicy($capability) { | ||||
// to whoever the blog is visible to. | // to whoever the blog is visible to. | ||||
switch ($capability) { | switch ($capability) { | ||||
case PhabricatorPolicyCapability::CAN_VIEW: | case PhabricatorPolicyCapability::CAN_VIEW: | ||||
if (!$this->isDraft() && $this->getBlog()) { | if (!$this->isDraft() && $this->getBlog()) { | ||||
return $this->getBlog()->getViewPolicy(); | return $this->getBlog()->getViewPolicy(); | ||||
} else if ($this->getBlog()) { | } else if ($this->getBlog()) { | ||||
return $this->getBlog()->getEditPolicy(); | return $this->getBlog()->getEditPolicy(); | ||||
} else { | |||||
return PhabricatorPolicies::POLICY_NOONE; | |||||
} | } | ||||
break; | break; | ||||
case PhabricatorPolicyCapability::CAN_EDIT: | case PhabricatorPolicyCapability::CAN_EDIT: | ||||
if ($this->getBlog()) { | if ($this->getBlog()) { | ||||
return $this->getBlog()->getEditPolicy(); | return $this->getBlog()->getEditPolicy(); | ||||
} else { | } else { | ||||
return PhabricatorPolicies::POLICY_NOONE; | return PhabricatorPolicies::POLICY_NOONE; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |