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

Reverted previous RoleHierarchy change

The previous attempt made plain security.context->isGranted() fail.
Extending Symfony's Role object makes everything fine, although the
solution is more than ugly.

Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
master
Gergely POLONKAI (W00d5t0ck) 10 years ago
parent f6acfae76d
commit 17bf54b4d6
  1. 3
      src/KekRozsak/SecurityBundle/Entity/Role.php
  2. 10
      src/KekRozsak/SecurityBundle/Service/RoleHierarchy.php

@ -4,6 +4,7 @@ namespace KekRozsak\SecurityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\RoleInterface;
use Symfony\Component\Security\Core\Role\Role as SymfonyRole;
/**
* KekRozsak\SecurityBundle\Entity\Role
@ -11,7 +12,7 @@ use Symfony\Component\Security\Core\Role\RoleInterface;
* @ORM\Entity
* @ORM\Table(name="roles")
*/
class Role implements RoleInterface
class Role extends SymfonyRole implements RoleInterface
{
/**
* The ID of the Role

@ -24,19 +24,15 @@ class RoleHierarchy implements RoleHierarchyInterface
{
$reachableRoles = array();
foreach ($roles as $role) {
if ($role instanceof RoleInterface) {
$thisRole = $role->getRole();
} else {
$thisRole = $role;
}
$thisRole = $role->getRole();
if (!isset($this->map[$thisRole])) {
continue;
}
$reachableRoles[] = $thisRole;
$reachableRoles[] = $role;
foreach ($this->map[$thisRole] as $r) {
if (($childRole = $this->roleRepo->findOneByName($r)) !== null) {
$reachableRoles[] = $childRole->getRole();
$reachableRoles[] = $childRole;
}
}
}

Loading…
Cancel
Save