Skip to content

Commit 5f1dda8

Browse files
committed
bug #20403 [Security] Fix wrong method call of the decision manager (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
2 parents 6c5aa0b + 97599f7 commit 5f1dda8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

security/impersonating_user.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,12 @@ logic you want::
337337
}
338338

339339
// you can still check for ROLE_ALLOWED_TO_SWITCH
340-
if ($this->accessDecisionManager->isGranted($token, ['ROLE_ALLOWED_TO_SWITCH'])) {
340+
if ($this->accessDecisionManager->decide($token, ['ROLE_ALLOWED_TO_SWITCH'])) {
341341
return true;
342342
}
343343

344344
// check for any roles you want
345-
if ($this->accessDecisionManager->isGranted($token, ['ROLE_TECH_SUPPORT'])) {
345+
if ($this->accessDecisionManager->decide($token, ['ROLE_TECH_SUPPORT'])) {
346346
return true;
347347
}
348348

security/voters.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ with ``ROLE_SUPER_ADMIN``::
248248
// ...
249249

250250
// ROLE_SUPER_ADMIN can do anything! The power!
251-
if ($this->accessDecisionManager->isGranted($token, ['ROLE_SUPER_ADMIN'])) {
251+
if ($this->accessDecisionManager->decide($token, ['ROLE_SUPER_ADMIN'])) {
252252
return true;
253253
}
254254

0 commit comments

Comments
 (0)