3 final class PhameInheritBlogPolicyRule
4 extends PhabricatorPolicyRule
{
6 public function getObjectPolicyKey() {
10 public function getObjectPolicyName() {
11 return pht('Same as Blog');
14 public function getPolicyExplanation() {
15 return pht('Use the same policy as the parent blog.');
18 public function getRuleDescription() {
19 return pht('inherit from blog');
22 public function getObjectPolicyIcon() {
26 public function canApplyToObject(PhabricatorPolicyInterface
$object) {
27 return ($object instanceof PhamePost
);
30 public function applyRule(
31 PhabricatorUser
$viewer,
33 PhabricatorPolicyInterface
$object) {
35 // TODO: This is incorrect in the general case, but: "PolicyRule" currently
36 // does not know which capability it is evaluating (so we can't test for
37 // the correct capability); and "PhamePost" currently has immutable view
38 // and edit policies (so we can only arrive here when evaluating the
41 return PhabricatorPolicyFilter
::hasCapability(
44 PhabricatorPolicyCapability
::CAN_INTERACT
);
47 public function getValueControlType() {
48 return self
::CONTROL_TYPE_NONE
;