monitoring: Return an empty filter in Controller::getRestriction() if the authenticated user is not restricted
This is because applyFilter requires a filter object.
This commit is contained in:
parent
432abb1d33
commit
2229665ec6
|
@ -60,9 +60,7 @@ class Controller extends IcingaWebController
|
||||||
*/
|
*/
|
||||||
protected function applyRestriction($name, Filterable $filterable)
|
protected function applyRestriction($name, Filterable $filterable)
|
||||||
{
|
{
|
||||||
if (null !== $restriction = $restriction = $this->getRestriction($name)) {
|
$filterable->applyFilter($this->getRestriction($name));
|
||||||
$filterable->applyFilter($restriction);
|
|
||||||
}
|
|
||||||
return $filterable;
|
return $filterable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +86,7 @@ class Controller extends IcingaWebController
|
||||||
));
|
));
|
||||||
foreach ($this->getRestrictions($name) as $filter) {
|
foreach ($this->getRestrictions($name) as $filter) {
|
||||||
if ($filter === '*') {
|
if ($filter === '*') {
|
||||||
return null;
|
return Filter::matchAny();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$restriction->addFilter(Filter::fromQueryString($filter));
|
$restriction->addFilter(Filter::fromQueryString($filter));
|
||||||
|
|
Loading…
Reference in New Issue