user23884942
user23884942

Reputation: 11

Remove all User rights from a User group in SAP Commerce?

We are trying to synchronise user rights from user group(s) across all environments. These rights can be exported just fine, but reimporting them on other environments is giving us some trouble. By importing user rights via a .csv file in the Hybris administration console, all of the rights defined in the .csv are simply appended to the existing rights (or overwritten for matching rights). But what we want to achieve is removal of the user rights that are not part of the exported user rights from the source environment.

We tried reimporting the .csv, tried running a groovy script and using the PermissionManagementService to no avail and also tried removing the rights via the Backoffice, which works, but it is not a viable option. We are talking about 6 environments per country, several user groups with several rights. This would take hours, if not days to clean out.

So how should we go about removing pre-existing user rights?

Upvotes: 1

Views: 134

Answers (1)

Antonio Robirosa
Antonio Robirosa

Reputation: 1

There isn't any way to do this using Impex. And it is too risky to change the database for this.

I can only think of two solutions:

  1. For each group in each environment, run a script which denies the rights for item types (using the sign -) which you have in the export file before importing the rights from your master environment

Depending in your user right concept, you should have a list of item types whose read or write or delete rights are different depending on the user groups. For example, Store, Address, Customer, Fields of the customers, Product, sub-classes of products, etc.

  1. In the long term, a better solution is to export the database and media files from production, run an anonymization SQL script to overwrite personal data and import that database into the other environments.

Although the second one is the most complex solution, it is a good practice and will prevent many bugs in production.

Upvotes: 0

Related Questions