diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:17:47 +0000 |
commit | 5419d4428c86c488a43124f85e5407d7cbae6541 (patch) | |
tree | 772c4221a20fd7d1b3e7e67c6e21755a50e80fd7 /library/Director/Data/HostServiceLoader.php | |
parent | Adding upstream version 1.10.2. (diff) | |
download | icingaweb2-module-director-5419d4428c86c488a43124f85e5407d7cbae6541.tar.xz icingaweb2-module-director-5419d4428c86c488a43124f85e5407d7cbae6541.zip |
Adding upstream version 1.11.1.upstream/1.11.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Director/Data/HostServiceLoader.php')
-rw-r--r-- | library/Director/Data/HostServiceLoader.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/library/Director/Data/HostServiceLoader.php b/library/Director/Data/HostServiceLoader.php index 4cc4b96..c8bd8b9 100644 --- a/library/Director/Data/HostServiceLoader.php +++ b/library/Director/Data/HostServiceLoader.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Data; use gipfl\IcingaWeb2\Table\QueryBasedTable; use gipfl\ZfDb\Select; +use Icinga\Authentication\Auth; use Icinga\Data\SimpleQuery; use Icinga\Module\Director\Db; use Icinga\Module\Director\Db\AppliedServiceSetLoader; @@ -26,21 +27,26 @@ class HostServiceLoader /** @var \Zend_Db_Adapter_Abstract */ protected $db; + /** @var Auth */ + protected $auth; + /** @var bool */ protected $resolveHostServices = false; /** @var bool */ protected $resolveObjects = false; - public function __construct(Db $connection) + public function __construct(Db $connection, Auth $auth) { $this->connection = $connection; $this->db = $connection->getDbAdapter(); + $this->auth = $auth; } public function fetchServicesForHost(IcingaHost $host) { - $table = (new ObjectsTableService($this->connection))->setHost($host); + $table = (new ObjectsTableService($this->connection, $this->auth)) + ->setHost($host); $services = $this->fetchServicesForTable($table); if ($this->resolveHostServices) { foreach ($this->fetchAllServicesForHost($host) as $service) { @@ -69,7 +75,7 @@ class HostServiceLoader /** @var IcingaHost[] $parents */ $parents = IcingaTemplateRepository::instanceByObject($host)->getTemplatesFor($host, true); foreach ($parents as $parent) { - $table = (new ObjectsTableService($this->connection)) + $table = (new ObjectsTableService($this->connection, $this->auth)) ->setHost($parent) ->setInheritedBy($host); foreach ($this->fetchServicesForTable($table) as $service) { |