Skip to content
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

warn of Symfony\Component\Security\Core\Authorization\Voter\Voter use with subjects #20732

Open
landure opened this issue Mar 7, 2025 · 0 comments

Comments

@landure
Copy link

landure commented Mar 7, 2025

Symfony\Component\Security\Core\Authorization\Voter\Voter is a CacheableVoterInterface.

The results are cached by subject class, not by subject value, or ORM\Id.

When the Voter must depend on the subject value (or state), the Voter result should not be cached.

Please add a warning like this one:

The AccessDecisionManager cache voters' results by subject class, not by subject value. If the Voter result depends on the subject value, don't extend Symfony\Component\Security\Core\Authorization\Voter\Voter, implement VoterInterface directly.

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

No branches or pull requests

1 participant