Skip to content

Commit

Permalink
[book][security] Adding namespace so that an example is more usable
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed May 14, 2011
1 parent 4ed0f96 commit 058844d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ authorization from inside a controller:

.. code-block:: php
use Symfony\Component\Security\Core\Exception\AccessDeniedException
// ...
public function helloAction($name)
{
if (false === $this->get('security.context')->isGranted('ROLE_ADMIN')) {
Expand Down

0 comments on commit 058844d

Please sign in to comment.