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);