Skip to content
Snippets Groups Projects
Commit a008753b authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #661 from EreMaijala/role-provider-fix

Check that roles is not null before trying to access it with foreach().
parents c09ac933 00df3664
No related merge requests found
......@@ -140,12 +140,14 @@ class DynamicRoleProvider implements RoleProviderInterface
$retVal = [];
foreach ($this->config as $settings) {
$current = $this->getRolesForSettings($settings);
foreach ($current['roles'] as $role) {
if (!isset($retVal[$role])) {
$retVal[$role] = [];
}
foreach ($current['permissions'] as $permission) {
$retVal[$role][] = $permission;
if (null !== $current['roles']) {
foreach ($current['roles'] as $role) {
if (!isset($retVal[$role])) {
$retVal[$role] = [];
}
foreach ($current['permissions'] as $permission) {
$retVal[$role][] = $permission;
}
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment