Skip to content

Commit 1b25c86

Browse files
committed
Merge pull request symfony#2359 from ftassi/fix-caution-note
Fix how to safely use is_granted in error pages
2 parents 40f7fdf + b2cd345 commit 1b25c86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cookbook/controller/error_pages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ end-user, create a new template located at
5656
by your error pages), because the router runs before the firewall. If
5757
the router throws an exception (for instance, when the route does not
5858
match), then using ``is_granted`` will throw a further exception. You
59-
can use ``is_granted`` safely by saying ``{% if app.security and is_granted('...') %}``.
59+
can use ``is_granted`` safely by saying ``{% if app.user is not null and is_granted('...') %}``.
6060

6161
.. tip::
6262

0 commit comments

Comments
 (0)