@@ -75,14 +75,14 @@ Authorization (i.e. Denying Access)
7575Symfony gives you several ways to enforce authorization, including the ``access_control ``
7676configuration in :doc: `security.yml </reference/configuration/security >` the
7777:ref: `@Security annotation <best-practices-security-annotation >` and using
78- :ref: `isGranted <best-practices-directly-isGranted >` on the ``security.context ``
78+ :ref: `isGranted <best-practices-directly-isGranted >` on the ``security.authorization_checker ``
7979service directly.
8080
8181.. best-practice ::
8282
8383 * For protecting broad URL patterns, use ``access_control ``;
8484 * Whenever possible, use the ``@Security `` annotation;
85- * Check security directly on the ``security.context `` service whenever
85+ * Check security directly on the ``security.authorization_checker `` service whenever
8686 you have a more complex situation.
8787
8888There are also different ways to centralize your authorization logic, like
@@ -315,7 +315,7 @@ Now, you can use the voter with the ``@Security`` annotation:
315315 // ...
316316 }
317317
318- You can also use this directly with the ``security.context `` service, or
318+ You can also use this directly with the ``security.authorization_checker `` service, or
319319via the even easier shortcut in a controller:
320320
321321.. code-block :: php
@@ -327,7 +327,7 @@ via the even easier shortcut in a controller:
327327 {
328328 $post = // query for the post ...
329329
330- if (!$this->get('security.context ')->isGranted('edit', $post)) {
330+ if (!$this->get('security.authorization_checker ')->isGranted('edit', $post)) {
331331 throw $this->createAccessDeniedException();
332332 }
333333 }
0 commit comments