Skip to content

Commit 26b54b4

Browse files
committed
minor symfony#13282 Replace former SecurityContext argument by TokenStorage (l-vo)
This PR was merged into the 3.4 branch. Discussion ---------- Replace former SecurityContext argument by TokenStorage Replace former SecurityContext argument by TokenStorage in AccessListener constructor Commits ------- ee0a8be Replace former SecurityContext argument by TokenStorage
2 parents c8df8e4 + ee0a8be commit 26b54b4

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)