Skip to content

Commit ee0a8be

Browse files
committed
Replace former SecurityContext argument by TokenStorage
1 parent 63c92a1 commit ee0a8be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/security/authorization.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,17 @@ which contains request matchers and a corresponding set of attributes that
237237
are required for the current user to get access to the application::
238238

239239
use Symfony\Component\HttpFoundation\RequestMatcher;
240+
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
240241
use Symfony\Component\Security\Http\AccessMap;
241242
use Symfony\Component\Security\Http\Firewall\AccessListener;
242243

243244
$accessMap = new AccessMap();
245+
$tokenStorage = new TokenStorage();
244246
$requestMatcher = new RequestMatcher('^/admin');
245247
$accessMap->add($requestMatcher, ['ROLE_ADMIN']);
246248

247249
$accessListener = new AccessListener(
248-
$securityContext,
250+
$tokenStorage,
249251
$accessDecisionManager,
250252
$accessMap,
251253
$authenticationManager

0 commit comments

Comments
 (0)