From a1d492dab6e08d4ea769462796002cf5104d785b Mon Sep 17 00:00:00 2001 From: saifulislamferoz Date: Wed, 20 Nov 2024 22:37:30 +0600 Subject: [PATCH] fix: remove deprecations ROLE_PREVIOUS_ADMIN replaced by IS_IMPERSONATOR --- Common/UserAwareComponent.php | 2 +- Tests/Common/UserAwareComponentTest.php | 2 +- Tests/Resolver/EventResolverFactoryTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/UserAwareComponent.php b/Common/UserAwareComponent.php index 0e4854f..9a4eb1a 100644 --- a/Common/UserAwareComponent.php +++ b/Common/UserAwareComponent.php @@ -87,7 +87,7 @@ final protected function getImpersonatingUser() return null; } - if ($this->authChecker->isGranted('ROLE_PREVIOUS_ADMIN')) { + if ($this->authChecker->isGranted('IS_IMPERSONATOR')) { return $this->getImpersonatingUserFromRole($token); } diff --git a/Tests/Common/UserAwareComponentTest.php b/Tests/Common/UserAwareComponentTest.php index d181c46..5b4a6ce 100644 --- a/Tests/Common/UserAwareComponentTest.php +++ b/Tests/Common/UserAwareComponentTest.php @@ -106,7 +106,7 @@ private function mockSecurityAuthChecker($isGranted = false) { $this->authChecker->expects($this->once()) ->method('isGranted') - ->with('ROLE_PREVIOUS_ADMIN') + ->with('IS_IMPERSONATOR') ->willReturn($isGranted); } } diff --git a/Tests/Resolver/EventResolverFactoryTest.php b/Tests/Resolver/EventResolverFactoryTest.php index e5560c6..4224285 100644 --- a/Tests/Resolver/EventResolverFactoryTest.php +++ b/Tests/Resolver/EventResolverFactoryTest.php @@ -476,7 +476,7 @@ private function mockSecurityAuthChecker($isGranted = false) $authChecker->expects($this->once()) ->method('isGranted') - ->with('ROLE_PREVIOUS_ADMIN') + ->with('IS_IMPERSONATOR') ->willReturn($isGranted); $this->resolverFactory->setAuthChecker($authChecker);