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"
This commit is contained in:
Thomas Gelf 2018-02-25 18:15:12 +01:00
parent ad88207d84
commit 7525a7b0f6

View File

@ -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())
];
}