Skip to content

Commit 97f3849

Browse files
authored
use is_granted() instead of deprecated has_role()
Deprecated in symfony/symfony#27305
1 parent 3235d06 commit 97f3849

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

security/access_control.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ key:
265265
access_control:
266266
-
267267
path: ^/_internal/secure
268-
allow_if: "'127.0.0.1' == request.getClientIp() or has_role('ROLE_ADMIN')"
268+
allow_if: "'127.0.0.1' == request.getClientIp() or is_granted('ROLE_ADMIN')"
269269
270270
.. code-block:: xml
271271
@@ -279,7 +279,7 @@ key:
279279
280280
<config>
281281
<rule path="^/_internal/secure"
282-
allow-if="'127.0.0.1' == request.getClientIp() or has_role('ROLE_ADMIN')" />
282+
allow-if="'127.0.0.1' == request.getClientIp() or is_granted('ROLE_ADMIN')" />
283283
</config>
284284
</srv:container>
285285
@@ -288,7 +288,7 @@ key:
288288
'access_control' => array(
289289
array(
290290
'path' => '^/_internal/secure',
291-
'allow_if' => '"127.0.0.1" == request.getClientIp() or has_role("ROLE_ADMIN")',
291+
'allow_if' => '"127.0.0.1" == request.getClientIp() or is_granted("ROLE_ADMIN")',
292292
),
293293
),
294294

0 commit comments

Comments
 (0)