Question
SCSK USA Inc
US
Last activity: 11 Apr 2019 9:51 EDT
How to create restriction on search results for users
Hi Community,
We would like to restrict some search results for users when they use the standard search function in Pega. Would anyone be able to enlightening or re-direct us on how this is done?
Thanks,
Masato
***Edited by Moderator Marissa to update platform capability tags; update SR details****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
What exactly are you trying to restrict? Are there specific classes you don't want some users to see work objects from or something else?
What version of Pega is in use?
SCSK USA Inc
US
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.
Masato
SCSK USA Inc
US
Can anyone provide any feedback or advice on how to do this?
Masato
Pegasystems Inc.
US
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).
-
Nathan Desmet
SCSK USA Inc
US
Hi Nick,
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.
Masato
-
Ayyeswararao Vadlamudi Yi Shan Chua
SCSK USA Inc
US
Hi Nick,
I was able to set up the filter for pySearchWorkParams through the screenshot attached, however this filter does not have any impact to the results.
Do you think this is due to the filter being incorrectly set up or version difference(we are using 8.1)?
Thanks,
Masato
******************************************
.pyParams(<APPEND>).pyName = pyWorkPage.pyOwnerOrgUnit
.pyParams(<LAST>).pyValue = OperatorID.pyOrgUnit
.pyParams(<LAST>).pySection = "Work"
******************************************
Pegasystems Inc.
US
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.