Revert the type declaration for Role, because users might do duck typing.
This commit is contained in:
parent
833909bd68
commit
66adc9f1c8
@ -14,7 +14,6 @@ namespace Symfony\Component\Security\Core\Authorization\Voter;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\ExpressionLanguage;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
|
||||
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
|
||||
use Symfony\Component\ExpressionLanguage\Expression;
|
||||
@ -86,7 +85,7 @@ class ExpressionVoter implements VoterInterface
|
||||
'user' => $token->getUser(),
|
||||
'object' => $subject,
|
||||
'subject' => $subject,
|
||||
'roles' => array_map(function (Role $role) { return $role->getRole(); }, $roles),
|
||||
'roles' => array_map(function ($role) { return $role->getRole(); }, $roles),
|
||||
'trust_resolver' => $this->trustResolver,
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user