@@ -211,8 +211,10 @@ Now you can reuse this method both in the template and in the security expressio
211211Manually Checking Permissions
212212-----------------------------
213213
214- If you cannot control the access based on URL patterns, you can always do
215- the security checks in PHP:
214+ The above example with ``@Security `` only works because we're using the
215+ :ref: `ParamConverter <best-practices-paramconverter >`, which gives the expression
216+ access to the a ``post `` variable. If you don't use this, or have some other
217+ more advanced use-case, you can always do the same security check in PHP:
216218
217219..code-block ::php
218220
@@ -300,7 +302,21 @@ To enable the security voter in the application, define a new service:
300302tags :
301303 -{ name: security.voter }
302304
303- Now, you can use the voter with the ``security.context `` service:
305+ Now, you can use the voter with the ``@Security `` annotation:
306+
307+ ..code-block ::php
308+
309+ /**
310+ * @Route("/{id}/edit", name="admin_post_edit")
311+ * @Security("is_granted('edit', post)")
312+ */
313+ public function editAction(Post $post)
314+ {
315+ // ...
316+ }
317+
318+ You can also use this directly with the ``security.context `` service or via
319+ the even easier shortcut in a controller:
304320
305321..code-block ::php
306322