Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50c8227

Browse files
committed
[#5015] Updating the security service name for 2.6 - thanks to Cordoval
1 parent4d22a78 commit50c8227

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎cookbook/security/impersonating_user.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ over the user's roles until you find one that a ``SwitchUserRole`` object::
9292

9393
use Symfony\Component\Security\Core\Role\SwitchUserRole;
9494

95-
$securityContext = $this->get('security.context');
95+
$authChecker = $this->get('security.authorization_checker');
9696

97-
if ($securityContext->isGranted('ROLE_PREVIOUS_ADMIN')) {
98-
foreach ($securityContext->getToken()->getRoles() as $role) {
97+
if ($authChecker->isGranted('ROLE_PREVIOUS_ADMIN')) {
98+
foreach ($authChecker->getToken()->getRoles() as $role) {
9999
if ($role instanceof SwitchUserRole) {
100100
$impersonatingUser = $role->getSource()->getUser();
101101
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp