summaryrefslogtreecommitdiffstats
path: root/configuration.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:45:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:45:29 +0000
commit0fa6f7723cca9bf7edc8af84112e8429e82dea84 (patch)
tree52c73718c9e2b6e4aa3f997791786aa2ee6ebcc9 /configuration.php
parentInitial commit. (diff)
downloadicingaweb2-module-nagvis-0fa6f7723cca9bf7edc8af84112e8429e82dea84.tar.xz
icingaweb2-module-nagvis-0fa6f7723cca9bf7edc8af84112e8429e82dea84.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')
+);