I want to allow impersonate user access to a custom role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2023 10:17 PM
I want to restrict impersonate user access to users who are having a custom role impersonate_user role. I have customized this script include "ImpersonateEvaluator" as below but not working as expected
var ImpersonateEvaluator = Class.create();
ImpersonateEvaluator.prototype = {
initialize: function() {},
type: 'ImpersonateEvaluator',
canImpersonate: function(currentUser, impersonatedUser) {
if (currentUser.hasRole('Impersonate_user'))
return false;
else
return true;
}
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 01:03 AM
Hello @sunil kumar6
Impersonation can only be performed by admin users in addition to the OOB role - 'impersonator'
This validation is done at the platform level codes, and cannot be overriten.
You can read the product documentation here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 01:18 AM
Hello @SatyakiBose
I have seen some users are customizing this script as per there requirement like below

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 01:22 AM
This community post is from 2018, and the platform has changed alot since then.
Am not sure if the same approach would work today.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 02:24 AM
Hi, you configure the common role to access the custom table. The below screenshot is an example, a similar way uses the same for your custom table.
Suresh.