In components you don't have an exclusion segment:
My subject is to create the opposite of a customer segment.
If I have a customer segment DEVELOPER then I would like to create EXCEPT_DEVELOPER ("Everyone can see this component except DEVELOPER").
We want to override/enhance the core method of Intershop which retrieve the assignement.
The goal to check if the user is in the EXCEPT customer segment dynamically.
...
...
forEach(CustomerSegment csItem : customerSegmentList) {
if(csItem.contains("EXCEPT")){ //EXCEPT~DEVELOPER
String customerSegmentToExcept = csItem.split("~")[1]; //DEVELOPER
if(currentUser.isIn(customerSegmentToExcept)) //current user is in customer segment DEVELOPER
return "Don't display component";
}
}
...
...
return "Display component";
What do you think ? Do you have some advice or another method to achieve this please ? Thank you !