10000 Allow getReachableRoles() to accept string array by pdugas · Pull Request #23153 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Allow getReachableRoles() to accept string array #23153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
Allow getReachableRoles() to accept string array
  • Loading branch information
pdugas authored Jun 12, 2017
commit a97034a741ada51204b78e534a8a3946c01239b6
4 changes: 2 additions & 2 deletions src/Symfony/Component/Security/Core/Role/RoleHierarchy.php
< 6B17 tr>
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
0