@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 46 lines 1.0 kB view raw
1<?php 2 3final class ConpherenceThreadMembersPolicyRule 4 extends PhabricatorPolicyRule { 5 6 public function getObjectPolicyKey() { 7 return 'conpherence.members'; 8 } 9 10 public function getObjectPolicyName() { 11 return pht('Room Participants'); 12 } 13 14 public function getPolicyExplanation() { 15 return pht('Participants in this room can take this action.'); 16 } 17 18 public function getRuleDescription() { 19 return pht('room participants'); 20 } 21 22 public function getObjectPolicyIcon() { 23 return 'fa-comments'; 24 } 25 26 public function canApplyToObject(PhabricatorPolicyInterface $object) { 27 return ($object instanceof ConpherenceThread); 28 } 29 30 public function applyRule( 31 PhabricatorUser $viewer, 32 $value, 33 PhabricatorPolicyInterface $object) { 34 $viewer_phid = $viewer->getPHID(); 35 if (!$viewer_phid) { 36 return false; 37 } 38 39 return (bool)$object->getParticipantIfExists($viewer_phid); 40 } 41 42 public function getValueControlType() { 43 return self::CONTROL_TYPE_NONE; 44 } 45 46}