We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0cf1828 commit bc22f16Copy full SHA for bc22f16
book/security.rst
@@ -1901,14 +1901,16 @@ You can also use expressions inside your templates:
1901
1902
.. code-block:: html+jinja
1903
1904
- {% if is_granted(expression('has_role("ROLE_ADMIN")')) %}
+ {% if is_granted(expression(
1905
+ '"ROLE_ADMIN" in roles or (user and user.isSuperAdmin())'
1906
+ )) %}
1907
<a href="...">Delete</a>
1908
{% endif %}
1909
1910
.. code-block:: html+php
1911
1912
<?php if ($view['security']->isGranted(new Expression(
- 'has_role("ROLE_ADMIN")'
1913
1914
))): ?>
1915
1916
<?php endif; ?>
0 commit comments