Path: blob/master/src/applications/calendar/policyrule/PhabricatorCalendarEventHostPolicyRule.php
12256 views
<?php12final class PhabricatorCalendarEventHostPolicyRule3extends PhabricatorPolicyRule {45public function getObjectPolicyKey() {6return 'calendar.event.host';7}89public function getObjectPolicyName() {10return pht('Event Host');11}1213public function getPolicyExplanation() {14return pht('The host of this event can take this action.');15}1617public function getRuleDescription() {18return pht('event host');19}2021public function canApplyToObject(PhabricatorPolicyInterface $object) {22return ($object instanceof PhabricatorCalendarEvent);23}2425public function applyRule(26PhabricatorUser $viewer,27$value,28PhabricatorPolicyInterface $object) {2930$viewer_phid = $viewer->getPHID();31if (!$viewer_phid) {32return false;33}3435return ($object->getHostPHID() == $viewer_phid);36}3738public function getValueControlType() {39return self::CONTROL_TYPE_NONE;40}4142}434445