Skip to content

Commit 2035d62

Browse files
committed
Updating for new security service names in 2.6
1 parent 4166339 commit 2035d62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: cookbook/controller/service.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ controller:
273273

274274
*Simply inject doctrine instead of fetching it from the container*
275275

276-
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getUser` (service: ``security.context``)
276+
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getUser` (service: ``security.token_storage``)
277277
.. code-block:: php
278278
279279
$user = null;
280-
$token = $securityContext->getToken();
280+
$token = $tokenStorage->getToken();
281281
if (null !== $token && is_object($token->getUser())) {
282282
$user = $token->getUser();
283283
}
284284
285-
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::isGranted` (service: ``security.context``)
285+
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::isGranted` (service: ``security.authorization_checker``)
286286
.. code-block:: php
287287
288-
$securityContext->isGranted($attributes, $object);
288+
$authChecker->isGranted($attributes, $object);
289289
290290
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::redirect`
291291
.. code-block:: php

0 commit comments

Comments
 (0)