We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd0e142 commit df85a35Copy full SHA for df85a35
cookbook/controller/error_pages.rst
@@ -52,10 +52,11 @@ end-user, create a new template located at
52
53
.. caution::
54
55
- You **must not** use ``is_granted`` in your error pages, because the
56
- router runs before the firewall. If the router throws an exception (for
57
- instance, when the route does not match), the error page is not behind a
58
- firewall and ``app.user`` is not defined.
+ You **must not** use ``is_granted`` in your error pages (or layout used
+ by your error pages), because the router runs before the firewall. If
+ the router throws an exception (for instance, when the route does not
+ 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('...') %}``.
60
61
.. tip::
62
0 commit comments