From 32ccff57f43a286f2543e4c5cb20348ae87e82ba Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 10 Dec 2019 10:55:28 +0100 Subject: [PATCH] ObjectDetail: Apply customvar restrictions --- library/Icingadb/Widget/Detail/ObjectDetail.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php index ed52c56b..e55df321 100644 --- a/library/Icingadb/Widget/Detail/ObjectDetail.php +++ b/library/Icingadb/Widget/Detail/ObjectDetail.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Icingadb\Widget\Detail; +use Icinga\Application\Config; use Icinga\Application\Icinga; use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Common\HostLinks; @@ -18,6 +19,7 @@ use Icinga\Module\Icingadb\Widget\HorizontalKeyValue; use Icinga\Module\Icingadb\Widget\ItemList\CommentList; use Icinga\Module\Icingadb\Widget\ShowMore; use Icinga\Module\Icingadb\Widget\TagList; +use Icinga\Module\Icingadb\Compat\CustomvarFilter; use ipl\Html\BaseHtmlElement; use ipl\Html\Html; use ipl\Html\HtmlString; @@ -80,6 +82,13 @@ class ObjectDetail extends BaseHtmlElement $vars = $this->object->customvar->execute(); if ($vars->hasResult()) { + $vars = new CustomvarFilter( + $vars, + $this->objectType, + $this->getAuth()->getRestrictions('monitoring/blacklist/properties'), + Config::module('monitoring')->get('security', 'protected_customvars', '') + ); + $content[] = new CustomVarTable($vars); } else { $content[] = new EmptyState('No custom variables configured.');