Apply role to all users if the role is defined with users=*

If the users directive contains at least one single asterisk, the role is applied to all users.
So, this supports roles which define users=username, ..., * and users=*

refs #3095
This commit is contained in:
Eric Lippmann 2017-11-16 12:01:06 +01:00
parent 166f27b947
commit f495b390da
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ class AdmissionLoader
$username = strtolower($username);
if (! empty($section->users)) {
$users = array_map('strtolower', StringHelper::trimSplit($section->users));
if (in_array('*', $users)) {
return true;
}
if (in_array($username, $users)) {
return true;
}