Path: blob/master/src/applications/calendar/codex/PhabricatorCalendarEventPolicyCodex.php
12253 views
<?php12final class PhabricatorCalendarEventPolicyCodex3extends PhabricatorPolicyCodex {45public function getPolicyShortName() {6$object = $this->getObject();78if (!$object->isImportedEvent()) {9return null;10}1112return pht('Uses Import Policy');13}1415public function getPolicyIcon() {16$object = $this->getObject();1718if (!$object->isImportedEvent()) {19return null;20}2122return 'fa-download';23}2425public function getPolicyTagClasses() {26$object = $this->getObject();2728if (!$object->isImportedEvent()) {29return array();30}3132return array(33'policy-adjusted-special',34);35}3637public function getPolicySpecialRuleDescriptions() {38$object = $this->getObject();3940$rules = array();41$rules[] = $this->newRule()42->setDescription(43pht('The host of an event can always view and edit it.'));4445$rules[] = $this->newRule()46->setCapabilities(47array(48PhabricatorPolicyCapability::CAN_VIEW,49))50->setDescription(51pht('Users who are invited to an event can always view it.'));525354$rules[] = $this->newRule()55->setCapabilities(56array(57PhabricatorPolicyCapability::CAN_VIEW,58))59->setIsActive($object->isImportedEvent())60->setDescription(61pht(62'Imported events can only be viewed by users who can view '.63'the import source.'));6465$rules[] = $this->newRule()66->setCapabilities(67array(68PhabricatorPolicyCapability::CAN_EDIT,69))70->setIsActive($object->isImportedEvent())71->setDescription(72pht(73'Imported events can not be edited.'));7475return $rules;76}777879}808182