If you use the maps restriction by regex for a group of users, when a user that belongs to that group click on the map module, an error is shown: You're not allowed to view map "overview".
That's because if you don't specify a map, the default is picked up (overview map in this case).
But then there is a condition that check the name of the map with the restriction regex. If the restriction regex does not match the name of the default map (overview), it throws an exception.
I think that a possible solution is to get the list of the maps that can be reached also with the regex restriction and to show the first of them. If no maps are available, just show a page with a message on it, like: "You don't have access to the maps."
Steps to reproduce:
Create a limited maps usergroup by setting a valid regex (that not allows the default-map set in /modules/nagvis/config.ini or the "demo-overview") in nagvis/map/filter text field.
Create a user with the limited maps usergroup.
Login with that user.
Access to map module.
The error is displayed and no other maps are reachable because the map menu is not shown.
If you use the maps restriction by regex for a group of users, when a user that belongs to that group click on the map module, an error is shown: You're not allowed to view map "overview". That's because if you don't specify a map, the default is picked up (overview map in this case). But then there is a condition that check the name of the map with the restriction regex. If the restriction regex does not match the name of the default map (overview), it throws an exception.
Here is the stacktrace:
0 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Nagvis\Controllers\ShowController->mapAction()
1 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
2 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
3 /usr/share/php/Icinga/Application/Web.php(407): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
4 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
5 /usr/share/icingaweb2/public/index.php(4): require_once(String)
6 {main}
I think that a possible solution is to get the list of the maps that can be reached also with the regex restriction and to show the first of them. If no maps are available, just show a page with a message on it, like: "You don't have access to the maps."
Steps to reproduce:
Environment: