How to prevent the system initialization in the Hybris HAC?


Lock the system initialization:
You can avoid accidental initialization or update the system by locking those options from HAC. Now when we really want to perform this operation we can unlock it and use the functionality.

To lock the system for initialization and update add the unlocking (system.unlocking.disabled=true) properties to your local.properties file and rebuild your system.
Unlock the system initialization:
Let's you want to perform an update system from HAC but that option is locked. Don't worry, you can easily unlock it without restarting the system and perform an operation.
  • Set system.unlocking.disabled to false (HAC>configuration)
  • Go to /hac/platform/init, Click on Unlock.


Block/Redirect URL from the webserver:
In case, your business stakeholder wants to block initialization and update system from HAC. The idea here is to change its request mapping.

If you have a web server in place for admin console, You can block or redirect /hac/platform/initURL to some dummy URL(/hac/platform/NOinit) from the web server itself. Do the google for your web server configuration for the same.


Change request mapping in Hybris HAC(Not recommend):
HAC request mapping is done by defaultHacConfiguration.json file. You can change the request mapping itself for the initialization tab. you can use the hybris customize folder to replace the OOTB file. Read customize folder section
 {
    "path" : "/NOinit",
    "label" : "initialization",
    "skipPrefix" : false
  }




Change request mapping in storefront controller (Not sure, give a try):
Create a storefront controller and have the same request mapping, inside the controller we will redirect the request to some dummy URL.


Give the HAC tab specific access to a user using Roles:
From Hybris V 6.1 onward you can easily configure which HAC tab/action users can or can't access or perform by assigning predefined roles. You can also create your custom roles using the Spring Security framework.

To use OOTB HAC roles, all you have to do is assign a specific user group to your user and you are done. There are predefined user groups like ROLE_HAC_PLATFORM_LOGGING, ROLE_HAC_PLATFORM_INITIALIZATION, ROLE_HAC_PLATFORM_UPDATE, etc.

Find all full list of HAC roles and more details here.


Author Image

Ankitkumar Patel

Sr. SAP Hybris consultant, having 6+ years experience in Hybris, Java, J2EE. Extensive hands-on experience in SAP Hybris development, third-party integrations with Hybris, project architecture and design... Read more

Comments

Popular posts from this blog

Hybris flexible search query examples

How to remove or update all data records in Hybris?

Hybris backoffice customization