summaryrefslogtreecommitdiffstats
path: root/configuration.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:25:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:25:24 +0000
commitd76d47b12fdcc9e127d023661e806cf2ca8e7715 (patch)
tree52c73718c9e2b6e4aa3f997791786aa2ee6ebcc9 /configuration.php
parentInitial commit. (diff)
downloadicingaweb2-module-nagvis-upstream.tar.xz
icingaweb2-module-nagvis-upstream.zip
Adding upstream version 1.1.1.upstream/1.1.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'configuration.php')
-rw-r--r--configuration.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/configuration.php b/configuration.php
new file mode 100644
index 0000000..f6dcf64
--- /dev/null
+++ b/configuration.php
@@ -0,0 +1,41 @@
+<?php
+
+use Icinga\Application\Config;
+use Icinga\Module\Nagvis\RestrictionHelper;
+
+$section = $this->menuSection(N_('Maps'))
+ ->setUrl('nagvis/show/map')
+ ->setIcon('globe');
+
+$prio = 0;
+$restriction = RestrictionHelper::getRegex();
+foreach (Config::module('nagvis')->getSection('menu') as $name => $caption) {
+ if ($restriction !== null && ! preg_match($restriction, $name)) {
+ continue;
+ }
+ $section->add($caption, array(
+ 'url' => 'nagvis/show/map',
+ 'urlParameters' => array('map' => $name),
+ 'priority' => ++$prio
+ ));
+}
+
+$this->providePermission(
+ 'nagvis/edit',
+ $this->translate('Modify NagVis maps')
+);
+
+$this->providePermission(
+ 'nagvis/admin',
+ $this->translate('Nagvis administration')
+);
+
+$this->providePermission(
+ 'nagvis/overview',
+ $this->translate('NagVis general overview')
+);
+
+$this->provideRestriction(
+ 'nagvis/map/filter',
+ $this->translate('Filter NagVis maps')
+);