Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / maniphest / policyrule / ManiphestTaskAuthorPolicyRule.php
blob04a39ff71c9f2a09cfc224c99bb6c1cd6a0d300f
1 <?php
3 final class ManiphestTaskAuthorPolicyRule
4 extends PhabricatorPolicyRule {
6 public function getObjectPolicyKey() {
7 return 'maniphest.author';
10 public function getObjectPolicyName() {
11 return pht('Task Author');
14 public function getPolicyExplanation() {
15 return pht('The author of this task can take this action.');
18 public function getRuleDescription() {
19 return pht('task author');
22 public function canApplyToObject(PhabricatorPolicyInterface $object) {
23 return ($object instanceof ManiphestTask);
26 public function applyRule(
27 PhabricatorUser $viewer,
28 $value,
29 PhabricatorPolicyInterface $object) {
31 $viewer_phid = $viewer->getPHID();
32 if (!$viewer_phid) {
33 return false;
36 return ($object->getAuthorPHID() == $viewer_phid);
39 public function getValueControlType() {
40 return self::CONTROL_TYPE_NONE;