Path: blob/master/src/applications/almanac/editor/AlmanacServiceEditor.php
12256 views
<?php12final class AlmanacServiceEditor3extends AlmanacEditor {45public function getEditorObjectsDescription() {6return pht('Almanac Service');7}89public function getCreateObjectTitle($author, $object) {10return pht('%s created this service.', $author);11}1213public function getCreateObjectTitleForFeed($author, $object) {14return pht('%s created %s.', $author, $object);15}1617public function getTransactionTypes() {18$types = parent::getTransactionTypes();1920$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;21$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;2223return $types;24}2526protected function validateAllTransactions(27PhabricatorLiskDAO $object,28array $xactions) {2930$errors = parent::validateAllTransactions($object, $xactions);3132if ($object->isClusterService()) {33$can_manage = PhabricatorPolicyFilter::hasCapability(34$this->getActor(),35new PhabricatorAlmanacApplication(),36AlmanacManageClusterServicesCapability::CAPABILITY);37if (!$can_manage) {38$errors[] = new PhabricatorApplicationTransactionValidationError(39null,40pht('Restricted'),41pht('You do not have permission to manage cluster services.'),42null);43}44}4546return $errors;47}4849}505152