mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Simplify conditions
This commit is contained in:
parent
be2501eff2
commit
0a0805c68b
@ -183,12 +183,10 @@ class AdmissionLoader
|
||||
$assignedRoles = [];
|
||||
$isUnrestricted = false;
|
||||
foreach ($this->roleConfig as $roleName => $roleConfig) {
|
||||
$assigned = $this->match($username, $userGroups, $roleConfig);
|
||||
if ($assigned) {
|
||||
if ($this->match($username, $userGroups, $roleConfig)) {
|
||||
$assignedRoles[] = $roleName;
|
||||
}
|
||||
|
||||
if (! isset($roles[$roleName]) && $assigned) {
|
||||
if (! isset($roles[$roleName])) {
|
||||
foreach ($this->loadRole($roleName, $roleConfig) as $role) {
|
||||
/** @var Role $role */
|
||||
if (isset($roles[$role->getName()])) {
|
||||
@ -220,6 +218,7 @@ class AdmissionLoader
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Logger::debug(
|
||||
'Groups assigned for user "%s": %s',
|
||||
|
Loading…
x
Reference in New Issue
Block a user