From 7525a7b0f6daa76474d68d95ef401a7b264b9385 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 25 Feb 2018 18:15:12 +0100 Subject: [PATCH] ObjectsTable: allow to filter any type by name Not used yet, will make it easy to create restrictions like director/host/filter-by-name = "*.dev.example.com" --- library/Director/Web/Table/ObjectsTable.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Director/Web/Table/ObjectsTable.php b/library/Director/Web/Table/ObjectsTable.php index c8571c05..867772b2 100644 --- a/library/Director/Web/Table/ObjectsTable.php +++ b/library/Director/Web/Table/ObjectsTable.php @@ -6,6 +6,7 @@ use Icinga\Authentication\Auth; use Icinga\Module\Director\Db; use Icinga\Module\Director\Db\IcingaObjectFilterHelper; use Icinga\Module\Director\Objects\IcingaObject; +use Icinga\Module\Director\Restriction\FilterByNameRestriction; use Icinga\Module\Director\Restriction\HostgroupRestriction; use Icinga\Module\Director\Restriction\ObjectRestriction; use dipl\Html\Link; @@ -184,8 +185,12 @@ class ObjectsTable extends ZfQueryBasedTable protected function loadRestrictions() { + $db = $this->connection(); + $auth = $this->getAuth(); + return [ - new HostgroupRestriction($this->connection(), $this->getAuth()) + new HostgroupRestriction($db, $auth), + new FilterByNameRestriction($db, $auth, $this->getDummyObject()->getShortTableName()) ]; }