Allow a user to be assigned to multiple groups

This commit is contained in:
Flavio Copes
2015-10-20 15:58:07 +02:00
parent e27f638fe3
commit 77deea8ad4

View File

@@ -139,9 +139,11 @@ class User extends Data
}
//Check group access level
$group = $this->get('group');
if (self::getGrav()['config']->get("site.groups.{$group}.access.{$action}") === true) {
return true;
$groups = $this->get('groups');
foreach($groups as $group) {
if (self::getGrav()['config']->get("site.groups.{$group}.access.{$action}") === true) {
return true;
}
}
//Fallback to user access level