Right now, we have restriction for display/review a work/case record if request owner's org does not match the operator's org information. However, they are still able to search those work/case record in the search bar(although they cannot open it). We would like to also restrict them from being able to search as well.
I'm not sure if this still works in 8.x but it may. You can override pySearchWorkParams and add filters for search. Use a property-set for each filter, using the properties below:
.pyParams(<APPEND>).pyName - Property to filter on
.pyParams(<LAST>).pyValue - Value to filter on
.pyParams(<LAST>).pySection - What index to use, for this it should be "work"
Any number of filters can be added using property-sets, and filters will be ANDed for the elasticsearch query. If the filter Name is same for more than one filter, then filters will be joined by an OR.
You could grab some data from the user performing the search, then filter based on that (either filtering for it directly, or determining the filter to use).
Thank you for your reply in this, it is much appreciated. Would it be possible to provide some sample settings for this? Although great help, I cannot imagine what type of information to enter for the PropertyName and PropertyValue(for example, for .pyParams(<APPEND>).pyName, do I use <APPEND> directly or do I substitute it for something else?). It would be much easier for us to know how to input these information if we had reference or any sample screenshot for a working filter.
You could try tracing the search to make sure the values you expect to be passed in that activity are being passed (and it's actually being called).
Another troubleshooting step would be to enable debug on "PegaSearch.Searcher.ESQueryGenerator". This will show you the generated elasticsearch query in the log and you can see if your filter is in there / if it changes when you adjust the filter.