@@ -75,14 +75,14 @@ Authorization (i.e. Denying Access)
75
75
Symfony gives you several ways to enforce authorization, including the ``access_control ``
76
76
configuration in :doc: `security.yml </reference/configuration/security >` the
77
77
: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 ``
79
79
service directly.
80
80
81
81
.. best-practice ::
82
82
83
83
* For protecting broad URL patterns, use ``access_control ``;
84
84
* 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
86
86
you have a more complex situation.
87
87
88
88
There are also different ways to centralize your authorization logic, like
@@ -315,7 +315,7 @@ Now, you can use the voter with the ``@Security`` annotation:
315
315
// ...
316
316
}
317
317
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
319
319
via the even easier shortcut in a controller:
320
320
321
321
.. code-block :: php
@@ -327,7 +327,7 @@ via the even easier shortcut in a controller:
327
327
{
328
328
$post = // query for the post ...
329
329
330
- if (!$this->get('security.context ')->isGranted('edit', $post)) {
330
+ if (!$this->get('security.authorization_checker ')->isGranted('edit', $post)) {
331
331
throw $this->createAccessDeniedException();
332
332
}
333
333
}
0 commit comments