cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backoffice Restrictions only for update Product with specific properties

0 Likes
1,036

Hello Experts,

I have the following group of employees that I have called coustomercaregroup and I also set the userrights in this way:

Now, i would like that this group can see through backoffice all types of Products but can modify only the products that have a certain value inside the attribute ProductModel.national = false (boolean), only in this case people that belong to this group can modify the product otherwise they cannot. If a product has in the field Product.national=true then who belongs to the customercaregroup can only visualize it but not modify it.

I don't know if it's possible to do something like this and I don't even know how to do it. Can anyone tell me how to do this?

Maybe i need to modify SolrIndexerQuery for Products? But how?

I would prefer a solution via impex but any advice is welcome.

Thanks in advance for the help

Accepted Solutions (0)

Answers (1)

Answers (1)

adiputera
Active Participant
0 Likes

You can implement PrepareInterceptor for that

@Override
public void onPrepare(ProductModel productModel, InterceptorContext ctx) throws InterceptorException
{ EmployeeModel employee = // get current user if (Boolean.TRUE.equals(productModel.getIsNational()) && // logic for your employee) { throw new InterceptorException("You cannot modify this product"); } }