Navigation: Allow basic wildcard to share navigation items

This commit is contained in:
Johannes Meyer 2015-10-01 13:56:28 +02:00
parent b80cfe7cdc
commit c7d5e1456a
1 changed files with 6 additions and 1 deletions

View File

@ -151,7 +151,7 @@ class Web extends EmbeddedWeb
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;
}
@ -159,6 +159,11 @@ class Web extends EmbeddedWeb
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)) {