The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Fixed RoleHierarchy class to return an array of strings instead of array of objects

Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
master
Gergely POLONKAI (W00d5t0ck) 10 years ago
parent 8bee5a4217
commit bf41a6f92f
  1. 13
      src/KekRozsak/SecurityBundle/Service/RoleHierarchy.php

@ -4,6 +4,7 @@ namespace KekRozsak\SecurityBundle\Service;
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\Security\Core\Role\RoleInterface;
class RoleHierarchy implements RoleHierarchyInterface
{
@ -23,13 +24,19 @@ class RoleHierarchy implements RoleHierarchyInterface
{
$reachableRoles = array();
foreach ($roles as $role) {
if (!isset($this->map[$role->getRole()])) {
if ($role instanceof RoleInterface) {
$thisRole = $role->getRole();
} else {
$thisRole = $role;
}
if (!isset($this->map[$thisRole])) {
continue;
}
$reachableRoles[] = $thisRole;
foreach ($this->map[$role->getRole()] as $r) {
foreach ($this->map[$thisRole] as $r) {
if (($childRole = $this->roleRepo->findOneByName($r)) !== null) {
$reachableRoles[] = $childRole;
$reachableRoles[] = $childRole->getRole();
}
}
}

Loading…
Cancel
Save