on ‎2018 Nov 01 2:37 PM
We have a customer that wants to implement early login for all the product-related pages on their B2B site on Commerce 6.3 (Cloud), but doesn't want this to apply to content pages (non-transactional e.g. Home, Contact Us, About Us etc.). Basically they want anonymous users to only see the non-transactional content pages and only logged in users to see the product related pages. Is there a way to do this with early login or do we have to build the restrictions into each page/component?
Request clarification before answering.
go to your storefront/web/webroot/WEB-INF/config. then you will see below entries.
<security:intercept-url pattern="/my-account/addressform" access="hasAnyRole('ROLE_ANONYMOUS','ROLE_CUSTOMERGROUP')" requires-channel="https" />
there u add your relative path
<security:intercept-url pattern="/my-account/<<url>>" access="hasAnyRole('ROLE_ANONYMOUS','ROLE_CUSTOMERGROUP')" requires-channel="https" />
do a clean build. run the server and check
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you - all solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great thanks.
My entry into the file: \hybris\bin\custom\yb2bacceleratorstorefront\web\webroot\WEB-INF\config\spring-security-config.xml
<security:intercept-url pattern="/**/c/**" access="hasRole('ROLE_CUSTOMERGROUP')" requires-channel="https" />
<security:intercept-url pattern="/**/p/**" access="hasRole('ROLE_CUSTOMERGROUP')" requires-channel="https" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.