Skip to content

Commit

Permalink
Navigation: Allow basic wildcard to share navigation items
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Meyer committed Oct 1, 2015
1 parent b80cfe7 commit c7d5e14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Icinga/Application/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,19 @@ private function hasAccessToSharedNavigationItem(& $config)

if (isset($config['users'])) {
$users = array_map('trim', explode(',', strtolower($config['users'])));
if (in_array($this->user->getUsername(), $users, true)) {
if (in_array('*', $users, true) || in_array($this->user->getUsername(), $users, true)) {
unset($config['users']);
return true;
}
}

if (isset($config['groups'])) {
$groups = array_map('trim', explode(',', strtolower($config['groups'])));
if (in_array('*', $groups, true)) {
unset($config['groups']);
return true;
}

$userGroups = array_map('strtolower', $this->user->getGroups());
$matches = array_intersect($userGroups, $groups);
if (! empty($matches)) {
Expand Down

0 comments on commit c7d5e14

Please sign in to comment.