Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / phame / policyrule / PhameInheritBlogPolicyRule.php
blob4d8309d259c25ccefdc6b221895b5064e498dac6
1 <?php
3 final class PhameInheritBlogPolicyRule
4 extends PhabricatorPolicyRule {
6 public function getObjectPolicyKey() {
7 return 'phame.blog';
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() {
23 return 'fa-feed';
26 public function canApplyToObject(PhabricatorPolicyInterface $object) {
27 return ($object instanceof PhamePost);
30 public function applyRule(
31 PhabricatorUser $viewer,
32 $value,
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
39 // interact policy).
41 return PhabricatorPolicyFilter::hasCapability(
42 $viewer,
43 $object->getBlog(),
44 PhabricatorPolicyCapability::CAN_INTERACT);
47 public function getValueControlType() {
48 return self::CONTROL_TYPE_NONE;