restrictions: Include restriction's section name in user restrictions

This commit is contained in:
Eric Lippmann 2014-10-01 14:08:21 +02:00
parent 64d41ac5a3
commit 74bd9b319d

View File

@ -75,12 +75,12 @@ class AdmissionLoader
} catch (NotReadableError $e) { } catch (NotReadableError $e) {
return $restrictions; return $restrictions;
} }
foreach ($config as $section) { foreach ($config as $name => $section) {
if ($this->match($section, $username, $groups)) { if ($this->match($section, $username, $groups)) {
if (!array_key_exists($section->name, $restrictions)) { if (!array_key_exists($section->name, $restrictions)) {
$restrictions[$section->name] = array(); $restrictions[$section->name] = array();
} }
$restrictions[$section->name][] = $section->restriction; $restrictions[$section->name][$name] = $section->restriction;
} }
} }
return $restrictions; return $restrictions;