Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
bug #629 Fix has_role compatibility in Symfony 3.4 (ostrolucky)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.4.x-dev branch.

Discussion
----------

Fix has_role compatibility in Symfony 3.4

Fixes #628

Looked into tests too, but didn't see any simple way to write a test for 3.4 only, while avoiding deprecations

Commits
-------

ec6f18e Fix has_role compatibility in Symfony 3.4
  • Loading branch information
fabpot committed Jul 8, 2019
2 parents 646b3f2 + ec6f18e commit 585f4b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions EventListener/SecurityListener.php
Expand Up @@ -98,6 +98,10 @@ private function getVariables(KernelEvent $event)
} else {
$roles = $token->getRoles();
}

$roles = array_map(function ($role) {
return $role->getRole();
}, $roles);
}

$variables = [
Expand Down

0 comments on commit 585f4b3

Please sign in to comment.