on ‎2021 Nov 25 10:24 PM
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
Request clarification before answering.
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");
}
}
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.