Skip to content

Commit 903b1b4

Browse files
committed
minor #13321 Typo in allow_if condition in access_control security (pohlaniacz)
This PR was merged into the 3.4 branch. Discussion ---------- Typo in allow_if condition in access_control security Fix typo in allow_if condition when trying to access headers. With old `request.header.has('X-Secure-Access')` there is a notice "Undefined property". Commits ------- 24ebee7 Typo in allow_if condition
2 parents 92f534a + 24ebee7 commit 903b1b4

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
@@ -291,7 +291,7 @@ key:
291291
# the 'role' and 'allow-if' options work like an OR expression, so
292292
# access is granted if the expression is TRUE or the user has ROLE_ADMIN
293293
roles: 'ROLE_ADMIN'
294-
allow_if: "'127.0.0.1' == request.getClientIp() or request.header.has('X-Secure-Access')"
294+
allow_if: "'127.0.0.1' == request.getClientIp() or request.headers.has('X-Secure-Access')"
295295
296296
.. code-block:: xml
297297
@@ -308,7 +308,7 @@ key:
308308
access is granted if the expression is TRUE or the user has ROLE_ADMIN -->
309309
<rule path="^/_internal/secure"
310310
role="ROLE_ADMIN"
311-
allow-if="'127.0.0.1' == request.getClientIp() or request.header.has('X-Secure-Access')"/>
311+
allow-if="'127.0.0.1' == request.getClientIp() or request.headers.has('X-Secure-Access')"/>
312312
</config>
313313
</srv:container>
314314
@@ -320,7 +320,7 @@ key:
320320
// the 'role' and 'allow-if' options work like an OR expression, so
321321
// access is granted if the expression is TRUE or the user has ROLE_ADMIN
322322
'roles' => 'ROLE_ADMIN',
323-
'allow_if' => '"127.0.0.1" == request.getClientIp() or request.header.has('X-Secure-Access')',
323+
'allow_if' => '"127.0.0.1" == request.getClientIp() or request.headers.has('X-Secure-Access')',
324324
],
325325
],
326326

0 commit comments

Comments
 (0)