1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/drydock/application/PhabricatorApplicationDrydock.php
epriestley 4489204361 Add Drydock default edit/view policies and a "Create Blueprint" policy
Summary: Ref T2015. Allow configuration of default edit/view policies for blueprints. Add create policy. Remove administrative exception in policies.

Test Plan: Configured these settings and created (or, with a restrictive create setting, tried to create) blueprints.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D7921
2014-01-09 12:19:45 -08:00

74 lines
2 KiB
PHP

<?php
final class PhabricatorApplicationDrydock extends PhabricatorApplication {
public function getBaseURI() {
return '/drydock/';
}
public function getShortDescription() {
return pht('Allocate Software Resources');
}
public function getIconName() {
return 'drydock';
}
public function getTitleGlyph() {
return "\xE2\x98\x82";
}
public function getFlavorText() {
return pht('A nautical adventure.');
}
public function getApplicationGroup() {
return self::GROUP_UTILITIES;
}
public function isBeta() {
return true;
}
public function getRoutes() {
return array(
'/drydock/' => array(
'' => 'DrydockConsoleController',
'blueprint/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'DrydockBlueprintListController',
'(?P<id>[1-9]\d*)/' => 'DrydockBlueprintViewController',
'create/' => 'DrydockBlueprintCreateController',
'edit/(?:(?P<id>[1-9]\d*)/)?' => 'DrydockBlueprintEditController',
),
'resource/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'DrydockResourceListController',
'(?P<id>[1-9]\d*)/' => 'DrydockResourceViewController',
'(?P<id>[1-9]\d*)/close/' => 'DrydockResourceCloseController',
),
'lease/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'DrydockLeaseListController',
'(?P<id>[1-9]\d*)/' => 'DrydockLeaseViewController',
'(?P<id>[1-9]\d*)/release/' => 'DrydockLeaseReleaseController',
),
'log/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?' => 'DrydockLogListController',
),
),
);
}
protected function getCustomCapabilities() {
return array(
DrydockCapabilityDefaultView::CAPABILITY => array(
),
DrydockCapabilityDefaultEdit::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
DrydockCapabilityCreateBlueprints::CAPABILITY => array(
'default' => PhabricatorPolicies::POLICY_ADMIN,
),
);
}
}