From 27d1297303d69acca760c94e4b6eaec22c4d811c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 20 Jul 2017 11:06:58 +0200 Subject: [PATCH] InfraTabs: add missing tab class --- library/Director/Web/Tabs/InfraTabs.php | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 library/Director/Web/Tabs/InfraTabs.php diff --git a/library/Director/Web/Tabs/InfraTabs.php b/library/Director/Web/Tabs/InfraTabs.php new file mode 100644 index 00000000..eaa0f78b --- /dev/null +++ b/library/Director/Web/Tabs/InfraTabs.php @@ -0,0 +1,49 @@ +auth = $auth; + // We are not a BaseElement, not yet + $this->assemble(); + } + + protected function assemble() + { + $auth = $this->auth; + + if ($auth->hasPermission('director/audit')) { + $this->add('activitylog', [ + 'label' => $this->translate('Activity Log'), + 'url' => 'director/config/activities' + ]); + } + + if ($auth->hasPermission('director/deploy')) { + $this->add('deploymentlog', [ + 'label' => $this->translate('Deployments'), + 'url' => 'director/config/deployments' + ]); + } + + if ($auth->hasPermission('director/admin')) { + $this->add('infrastructure', [ + 'label' => $this->translate('Infrastructure'), + 'url' => 'director/dashboard', + 'urlParams' => ['name' => 'infrastructure'] + ]); + } + } +}