Skip to content

Commit 2684551

Browse files
BAP-22494 Parameter web_backend_prefix should not be used in platform (#39443)
--------- Co-authored-by: timofiyprisyazhnyuk <[email protected]>
1 parent d39a769 commit 2684551

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

backend/security/role-based-access-control.rst

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Example:
1818
# config/config.yaml
1919
oro_security:
2020
access_control:
21-
- { path: ^%web_backend_prefix%/contact$, roles: ANY_ROLE }
21+
- { path: ^/contact$, roles: ANY_ROLE }
2222
2323
By default, the final rule list is sorted in the following order:
2424

@@ -29,7 +29,7 @@ By default, the final rule list is sorted in the following order:
2929
# config/config.yaml
3030
oro_security:
3131
access_control:
32-
- { path: ^%web_backend_prefix%/contact$, roles: security_yml_ROLE }
32+
- { path: ^/contact$, roles: security_yml_ROLE }
3333
3434
2. The list merged from vendor bundles in the bundle loading order
3535

@@ -38,12 +38,12 @@ By default, the final rule list is sorted in the following order:
3838
# AclBundle/Resources/config/app.yml (5th. loaded bundle in kernel)
3939
oro_security:
4040
access_control:
41-
- { path: ^%web_backend_prefix%/contact$, roles: acl_bundle_ROLE }
41+
- { path: ^/contact$, roles: acl_bundle_ROLE }
4242
4343
# OroActivityContactBundle/Resources/config/app.yml (61st. loaded bundle in kernel)
4444
oro_security:
4545
access_control:
46-
- { path: ^%web_backend_prefix%/contact$, roles: activity_contact_bundle_ROLE }
46+
- { path: ^/contact$, roles: activity_contact_bundle_ROLE }
4747
4848
3. The list merged from the src folder
4949

@@ -52,7 +52,7 @@ By default, the final rule list is sorted in the following order:
5252
# src/Resources/config/app.yml
5353
oro_security:
5454
access_control:
55-
- { path: ^%web_backend_prefix%/contact$, roles: src_folder_ROLE, priority: 20 }
55+
- { path: ^/contact$, roles: src_folder_ROLE, priority: 20 }
5656
5757
If you want to override a rule and move to the top of the rule list which is going to be checked, you can use the ``priority`` flag.
5858

@@ -62,12 +62,23 @@ In the example above, the final list will look like the following.
6262

6363
.. code-block:: yaml
6464
65-
- { path: ^%web_backend_prefix%/contact$, roles: src_folder_ROLE }
66-
- { path: ^%web_backend_prefix%/contact$, roles: security_yml_ROLE }
67-
- { path: ^%web_backend_prefix%/contact$, roles: acl_bundle_ROLE }
68-
- { path: ^%web_backend_prefix%/contact$, roles: activity_contact_bundle_ROLE }
65+
- { path: ^/contact$, roles: src_folder_ROLE }
66+
- { path: ^/contact$, roles: security_yml_ROLE }
67+
- { path: ^/contact$, roles: acl_bundle_ROLE }
68+
- { path: ^/contact$, roles: activity_contact_bundle_ROLE }
6969
70-
The request coming for URL ``^%web_backend_prefix%/contact`` will be checked for role ``src_folder_ROLE`` because it was moved up for its priority of 20.
70+
The request coming for URL ``^/contact`` will be checked for role ``src_folder_ROLE`` because it was moved up for its priority of 20.
71+
72+
4. Specify the access control rule applies to frontstore
73+
74+
If you want to specify whether the access_control rule applies to frontstore, you need to add "frontend: true" to the parameters, otherwise "%web backend prefix%" will be added to the path.
75+
76+
.. code-block:: yaml
77+
78+
# src/Resources/config/app.yml
79+
oro_security:
80+
access_control:
81+
- { path: ^/contact$, roles: src_folder_ROLE, options: { frontend: true } }
7182
7283
.. include:: /include/include-links-dev.rst
73-
:start-after: begin
84+
:start-after: begin

0 commit comments

Comments
 (0)