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

[Security] add the $token argument to checkPostAuth() #20066

Open
wants to merge 1 commit into
base: 7.2
Choose a base branch
from

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jul 25, 2024

fixes #20062

@Timherlaud
Copy link
Contributor

Timherlaud commented Jul 25, 2024

Hello,

You can add the import of TokenInterface

use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

I think we can add a notice version :

.. versionadded:: 7.2

  The token argument for checkPostAuth function was introduced in Symfony 7.2.

And maybe an example of usage in function :

use Symfony\Component\Security\Core\Exception\AccessDeniedException;

if (!\in_array('foo', $token->getRoleNames())) {
                throw new AccessDeniedException('...');
            }

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

Successfully merging this pull request may close these issues.

3 participants