diff --git a/cookbook/profiler/matchers.rst b/cookbook/profiler/matchers.rst
index b23af0d21f0..c1494b38c1a 100644
--- a/cookbook/profiler/matchers.rst
+++ b/cookbook/profiler/matchers.rst
@@ -70,22 +70,22 @@ something like::
// src/Acme/DemoBundle/Profiler/SuperAdminMatcher.php
namespace Acme\DemoBundle\Profiler;
- use Symfony\Component\Security\Core\SecurityContext;
+ use Symfony\Component\Security\Core\Authorization\AuthorizationChecker;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
class SuperAdminMatcher implements RequestMatcherInterface
{
- protected $securityContext;
+ protected $authorizationChecker;
- public function __construct(SecurityContext $securityContext)
+ public function __construct(AuthorizationChecker $authorizationChecker)
{
- $this->securityContext = $securityContext;
+ $this->authorizationChecker = $authorizationChecker;
}
public function matches(Request $request)
{
- return $this->securityContext->isGranted('ROLE_SUPER_ADMIN');
+ return $this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN');
}
}
@@ -101,7 +101,7 @@ Then, you need to configure the service:
services:
acme_demo.profiler.matcher.super_admin:
class: "%acme_demo.profiler.matcher.super_admin.class%"
- arguments: ["@security.context"]
+ arguments: ["@security.authorization_checker"]
.. code-block:: xml
@@ -114,7 +114,7 @@ Then, you need to configure the service:
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: