Skip to content

Adding multiple acces roles per path fail in security.yml #36359

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
proeinfo opened this issue Apr 6, 2020 · 2 comments
Closed

Adding multiple acces roles per path fail in security.yml #36359

proeinfo opened this issue Apr 6, 2020 · 2 comments

Comments

@proeinfo
Copy link

proeinfo commented Apr 6, 2020

Symfony version(s) affected: 5.0.7

Description
Using multiple roles per path yields the error message

Passing more than one Security attribute to "Symfony\Component\Security\Core\Authorization\AccessDecisionManager::decide()" is not supported.

when accessing a matching page.

In the Symfony\Component\Security\Http\Firewall\AccessListener class, the decide method of the decision manager is called with the fourth parameter ($allowMultipleAttributes) set to true.

But the $allowMultipleAttributes parameter is not passed from Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager::decide() method.

This means that $allowMultipleAttributes isn't passed to Symfony\Component\Security\Core\Authorization\AccessDecisionManager which is the only access decision manager class that knows how to handle $allowMultipleAttributes.

How to reproduce
I'm not sure when TraceableAccessDecisionManager is called instead of AccessDecisionManager, but it may be as simple as adding multiple roles per path in the security.yml file.

Possible Solution
Update the AccessDecisionManagerInterface with the fourth parameter for the decide() method and add it to the TraceableAccessDecisionManager class and (fully) to the AccessDecisionManager class.

Additional context

@proeinfo
Copy link
Author

proeinfo commented Apr 6, 2020

@proeinfo
Copy link
Author

proeinfo commented Apr 6, 2020

Never mind, can see this is addressed here: symfony/security-core@79f27fb#diff-cb28a188dab3a129e181ae9c31655fae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants