From a97034a741ada51204b78e534a8a3946c01239b6 Mon Sep 17 00:00:00 2001 From: Paul Dugas Date: Mon, 12 Jun 2017 15:38:35 -0400 Subject: [PATCH] Allow getReachableRoles() to accept string array --- src/Symfony/Component/Security/Core/Role/RoleHierarchy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php b/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php index 95e76ee279316..5c211c4bb9821 100644 --- a/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php +++ b/src/Symfony/Component/Security/Core/Role/RoleHierarchy.php @@ -40,11 +40,11 @@ public function getReachableRoles(array $roles) { $reachableRoles = $roles; foreach ($roles as $role) { - if (!isset($this->map[$role->getRole()])) { + if (!isset($this->map[is_string($role) ? $role : $role->getRole()])) { continue; } - foreach ($this->map[$role->getRole()] as $r) { + foreach ($this->map[is_string($role) ? $role : $role->getRole()] as $r) { $reachableRoles[] = new Role($r); } }