permissions: Use a comma-separated list as config instead of the `permission_*' directives

Permissions are now set using a comma-separated list of permissions using the `permissions' config because
the `users' and `groups' are comma-separated lists too.
This commit is contained in:
Eric Lippmann 2014-10-01 08:14:03 +02:00
parent 266936b9b5
commit 084691570e
1 changed files with 2 additions and 6 deletions

View File

@ -52,12 +52,8 @@ class AdmissionLoader
return $permissions;
}
foreach ($config as $section) {
if ($this->match($section, $username, $groups)) {
foreach ($section as $key => $value) {
if (strpos($key, 'permission') === 0) {
$permissions = array_merge($permissions, String::trimSplit($value));
}
}
if ($this->match($section, $username, $groups) && isset($section->permissions)) {
$permissions += String::trimSplit($section->permissions);
}
}
return $permissions;