
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2018 12:12 AM
Hi Team, how can we limit the users to be selected in impersonation window? We have a requirement to allow only approved users to be available for impersonators to impersonate.
Solved! Go to Solution.
- Labels:
-
Instance Configuration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 07:41 AM
Thank you @iamkalai, I have used below condition in before query BR on sys_user table, and it works.
Condition: gs.getSession().isInteractive() && gs.action != ''
Script: if ((gs.action.getGlideURI().toString()).indexOf('impersonate') != -1 || (gs.action.getGlideURI().toString()).indexOf('angular.do?sysparm_type=ref_list_data') != -1) {
<YOUR CODE GOES HERE>
}
NOTE: Do not add above if condition in the condition field, orelse you will get java null pointer exception while updating record in sys_user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 01:28 AM
You will have to play around the condition and see if you can find the relevant condition. The best thing I would suggest you to edit ImpersonateEvaluator instead of going through all of this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 07:41 AM
Thank you @iamkalai, I have used below condition in before query BR on sys_user table, and it works.
Condition: gs.getSession().isInteractive() && gs.action != ''
Script: if ((gs.action.getGlideURI().toString()).indexOf('impersonate') != -1 || (gs.action.getGlideURI().toString()).indexOf('angular.do?sysparm_type=ref_list_data') != -1) {
<YOUR CODE GOES HERE>
}
NOTE: Do not add above if condition in the condition field, orelse you will get java null pointer exception while updating record in sys_user table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 09:45 PM
Tried it, works fine.
Thank you for sharing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2019 08:27 AM
I was curious if you could provide an example or two of the type of code that goes in <YOUR CODE GOES HERE> for me to use as a starting point? I would like to restrict to users to members of a specific group or who have been assigned a specific role.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 06:11 AM
That depends on your requirement, let me know the requirement.