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

Merged
merged 1 commit into from
Oct 16, 2024

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('...');
            }

@OskarStark OskarStark changed the title [Security] add the $token argument to checkPostAuth() [Security] add the $token argument to checkPostAuth() Oct 8, 2024
@alamirault
Copy link
Contributor

alamirault commented Oct 11, 2024

@xabbuh Do you have time to apply suggestions ?

(If not I can take care of this)

@javiereguiluz javiereguiluz merged commit cde34e1 into symfony:7.2 Oct 16, 2024
3 checks passed
@javiereguiluz
Copy link
Member

Thanks Christian!

@Timherlaud while merging I did all the changes that you suggested. Thanks a lot!

Antoine, if you think there's something else that should be documented about this, please create a new PR. Thanks!

@xabbuh
Copy link
Member Author

xabbuh commented Oct 17, 2024

Thank you Javier!

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.

5 participants