Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/almanac/application/PhabricatorAlmanacApplication.php
12256 views
1
<?php
2
3
final class PhabricatorAlmanacApplication extends PhabricatorApplication {
4
5
public function getBaseURI() {
6
return '/almanac/';
7
}
8
9
public function getName() {
10
return pht('Almanac');
11
}
12
13
public function getShortDescription() {
14
return pht('Service Directory');
15
}
16
17
public function getIcon() {
18
return 'fa-server';
19
}
20
21
public function getTitleGlyph() {
22
return "\xE2\x98\x82";
23
}
24
25
public function getApplicationGroup() {
26
return self::GROUP_UTILITIES;
27
}
28
29
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
30
return array(
31
array(
32
'name' => pht('Almanac User Guide'),
33
'href' => PhabricatorEnv::getDoclink('Almanac User Guide'),
34
),
35
);
36
}
37
38
public function getRoutes() {
39
return array(
40
'/almanac/' => array(
41
'' => 'AlmanacConsoleController',
42
'(?P<objectType>service)/' => array(
43
$this->getQueryRoutePattern() => 'AlmanacServiceListController',
44
$this->getEditRoutePattern('edit/') => 'AlmanacServiceEditController',
45
'view/(?P<name>[^/]+)/' => 'AlmanacServiceViewController',
46
),
47
'(?P<objectType>device)/' => array(
48
$this->getQueryRoutePattern() => 'AlmanacDeviceListController',
49
$this->getEditRoutePattern('edit/') => 'AlmanacDeviceEditController',
50
'view/(?P<name>[^/]+)/' => 'AlmanacDeviceViewController',
51
),
52
'interface/' => array(
53
'edit/(?:(?P<id>\d+)/)?' => 'AlmanacInterfaceEditController',
54
'delete/(?:(?P<id>\d+)/)?' => 'AlmanacInterfaceDeleteController',
55
),
56
'binding/' => array(
57
'edit/(?:(?P<id>\d+)/)?' => 'AlmanacBindingEditController',
58
'disable/(?:(?P<id>\d+)/)?' => 'AlmanacBindingDisableController',
59
'(?P<id>\d+)/' => 'AlmanacBindingViewController',
60
),
61
'network/' => array(
62
$this->getQueryRoutePattern() => 'AlmanacNetworkListController',
63
'edit/(?:(?P<id>\d+)/)?' => 'AlmanacNetworkEditController',
64
'(?P<id>\d+)/' => 'AlmanacNetworkViewController',
65
),
66
'namespace/' => array(
67
$this->getQueryRoutePattern() => 'AlmanacNamespaceListController',
68
$this->getEditRoutePattern('edit/')
69
=> 'AlmanacNamespaceEditController',
70
'(?P<id>\d+)/' => 'AlmanacNamespaceViewController',
71
),
72
'property/' => array(
73
'delete/' => 'AlmanacPropertyDeleteController',
74
'update/' => 'AlmanacPropertyEditController',
75
),
76
),
77
);
78
}
79
80
protected function getCustomCapabilities() {
81
$cluster_caption = pht(
82
'This permission is very dangerous. %s',
83
phutil_tag(
84
'a',
85
array(
86
'href' => PhabricatorEnv::getDoclink('Clustering Introduction'),
87
'target' => '_blank',
88
),
89
pht('Learn More')));
90
91
return array(
92
AlmanacCreateServicesCapability::CAPABILITY => array(
93
'default' => PhabricatorPolicies::POLICY_ADMIN,
94
),
95
AlmanacCreateDevicesCapability::CAPABILITY => array(
96
'default' => PhabricatorPolicies::POLICY_ADMIN,
97
),
98
AlmanacCreateNetworksCapability::CAPABILITY => array(
99
'default' => PhabricatorPolicies::POLICY_ADMIN,
100
),
101
AlmanacCreateNamespacesCapability::CAPABILITY => array(
102
'default' => PhabricatorPolicies::POLICY_ADMIN,
103
),
104
AlmanacManageClusterServicesCapability::CAPABILITY => array(
105
'default' => PhabricatorPolicies::POLICY_NOONE,
106
'caption' => $cluster_caption,
107
),
108
);
109
}
110
111
}
112
113