mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Merge pull request #3671 from Icinga/bugfix/getrestriction
Monitoring\Controller#getRestriction(): return filters matching all, not none (cherry picked from commit 1cce44453cf079b5994d9f05aaeab4d79d223bc6) Signed-off-by: Johannes Meyer <johannes.meyer@icinga.com>
This commit is contained in:
parent
60e3201c66
commit
6a8a7e397b
@ -97,7 +97,7 @@ class Controller extends IcingaWebController
|
||||
*
|
||||
* @param string $name Name of the restriction
|
||||
*
|
||||
* @return Filter|null Filter object or null if the authenticated user is not restricted
|
||||
* @return Filter Filter object
|
||||
* @throws ConfigurationError If the restriction contains invalid filter columns
|
||||
*/
|
||||
protected function getRestriction($name)
|
||||
@ -115,7 +115,7 @@ class Controller extends IcingaWebController
|
||||
));
|
||||
foreach ($this->getRestrictions($name) as $filter) {
|
||||
if ($filter === '*') {
|
||||
return Filter::matchAny();
|
||||
return Filter::matchAll();
|
||||
}
|
||||
try {
|
||||
$restriction->addFilter(Filter::fromQueryString($filter));
|
||||
@ -138,6 +138,11 @@ class Controller extends IcingaWebController
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($restriction->isEmpty()) {
|
||||
return Filter::matchAll();
|
||||
}
|
||||
|
||||
return $restriction;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user