Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc22f16

Browse files
committed
[symfony#3022][symfony#3258] Enhancing example at@ggam's suggestion
1 parent0cf1828 commitbc22f16

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎book/security.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,14 +1901,16 @@ You can also use expressions inside your templates:
19011901

19021902
..code-block::html+jinja
19031903

1904-
{% if is_granted(expression('has_role("ROLE_ADMIN")')) %}
1904+
{% if is_granted(expression(
1905+
'"ROLE_ADMIN" in roles or (user and user.isSuperAdmin())'
1906+
)) %}
19051907
<a href="...">Delete</a>
19061908
{% endif %}
19071909

19081910
..code-block::html+php
19091911

19101912
<?php if ($view['security']->isGranted(new Expression(
1911-
'has_role("ROLE_ADMIN")'
1913+
'"ROLE_ADMIN" in roles or (user and user.isSuperAdmin())'
19121914
))): ?>
19131915
<a href="...">Delete</a>
19141916
<?php endif; ?>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp