Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Nov 13, 2024

Following symfony/symfony#58754: calling. Security::isGranted() inside a voter has the drawback that we do not know if the checks performed here act on the same token that we have in our voter as the token inside the token storage might have change or may change in between.

@carsonbot carsonbot added this to the 5.4 milestone Nov 13, 2024
@carsonbot carsonbot changed the title [Security] use access decision manager to control which token to vote on [Security] use access decision manager to control which token to vote on Nov 13, 2024
@javiereguiluz javiereguiluz merged commit 0e8d2b6 into symfony:5.4 Nov 19, 2024
3 checks passed
@javiereguiluz
Copy link
Member

Christian, thanks for improving this.

Also, while merging I added a caution section with the same explanation that you shared here about why Security shouldn't be used: c9b77ef

@xabbuh xabbuh deleted the symfony-58754 branch November 19, 2024 09:51
OskarStark added a commit that referenced this pull request Nov 19, 2024
…Oliver Kossin)

This PR was merged into the 5.4 branch.

Discussion
----------

[Security] Fix wrong method call of the decision manager

`@xabbuh`  changed the use of “decision manage” in [PR-20388](#20388)  However, the method is described differently in the [interface](https://github.com/symfony/symfony/blob/7.2/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManagerInterface.php#L29).

It's not `isGranted` its `decide`

Commits
-------

97599f7 Fix isGranted to decide
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