When I impersonate with user I should get the roles what impersontor has

Gudipati Hemala
Tera Contributor

 

1. I have a requirement that when Impersonating a user with the sn_mh.manager_hub_user role, I should be able to get access to the data granted from sn_mh.manager_hub_user role even if I do not have the same role. Is this be possible ?

2. Where does current and impersonator user roles are manager in the system which impersonating ?

 

3. do we have any system logs if impersonation happens in portal?

4 REPLIES 4

Wind0004
Mega Guru

Hi Gudipati, 

To answer your questions; 

1. When you impersonate a user you adopt their whole profile i.e. including their roles. The only catch is that you cannot impersonate someone that has a higher privilege than the account your impersonating from. 


So if you impersonate as an admin - you should be able to adopt all roles apart from security admin (if you dont have that assigned in addition to the admin role)

 

2. Not too sure what you are asking here. Could you please clarify ? 

 

3. Yes , if you go the system log tables and then search where source= Impersonate , you should see all logs in which someone has impersonated a user , and when they ended the impersonation too. 

 

Hope that helps. 

 

Regards,

Wind 

 

hemalatha G
ServiceNow Employee
ServiceNow Employee

2. Where does current user and impersonator user roles are manager in the system when impersonating with another user ?

Maddysunil
Kilo Sage

@Gudipati Hemala 

  1. In ServiceNow, when impersonating a user with the sn_mh.manager_hub_user role, whether you can access data granted by that role without having the same role depends on the specific configuration and security settings of your instance. Generally, if the data access is controlled based on roles, you would need to have the necessary roles to access that data, even when impersonating another user. However, ServiceNow provides flexibility in managing data access through various means such as ACLs (Access Control Lists) and data policies. You may need to adjust these configurations to achieve the desired behavior.

  2. The current user and impersonator user roles are typically managed within the user records in the system. Each user record in ServiceNow has a "Roles" related list where you can view and manage the roles assigned to that user. When impersonating another user, the system temporarily switches your user context to that of the impersonated user, including their roles, until you stop impersonating.

  3. ServiceNow provides auditing and logging features that can track user activities, including impersonation. You can review system logs such as the "System Logs" (syslog) or "Transaction Logs" (transaction_log) to monitor impersonation events.

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

@Maddysunil 

Thanks for your response, It would be great if you could provide technical solution to achieve this ?