- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 06:28 PM
Hello,
I would like to restrict certain users who have the impersonator role to a sub-set of users that they can impersonate. I believe that this is achievable using a business rule - before query.
I found the below on another post however I have been unable to get this functioning in a business rule so if anyone can point me in the right direction or any other suggestions?
Thanks.
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)
var ImpersonateEvaluator = Class.create();
ImpersonateEvaluator.prototype = {
initialize: function() {},
type: 'ImpersonateEvaluator',
canImpersonate: function(currentUser, impersonatedUser) {
var userImpersonated = impersonatedUser.getID();
if(userImpersonated == '4444444444444444444') // refers to the sys_id of impersonated user
{
return false;
}
else
{
return true;
}
}
};
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 07:27 PM
Hi
in the list of all Script Includes you will find one with the name "ImpersonateEvaluator"
Open this Script Include and modify the the function as per your requirement
Apart from that no additional customizations are required.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2022 07:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2022 01:43 PM
Hi Maik,
Thanks for pointing me in the right direction.
Richo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2023 05:27 AM
Hello Richo,
where you able to restrict it. if yes can you please paste it. i have similar query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
I am looking restrict the list to only non itil users to be impersonated for anyone with impersonation role.. I have updated the script check the role of impersonated user . however this doesnt even restriction is applied on even for the admins,
is there any other alternative way without customising this OOTB script Include