Closed
Description
Symfony version(s) affected: all
Description
Passing an array into is_granted always returns false, while checking for the same as a individual role does not return false. according to the documentation, is_granted is supposed to support arrays as well as strings.
How to reproduce
{{ dump(is_granted(["ROLE_ADMIN"]) }}
{{ dump(is_granted("ROLE_ADMIN")) }}
Possible Solution
security-core/Authorization/Voter/RoleVoter.php
line 39++ needs to be rewritten to accept an array of $attribute in order to satisfy the specification that is_granted can accept both string and string[] (ref: https://symfony.com/doc/current/reference/twig_reference.html#is-granted)