impersonating
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 02:15 AM
Hi All how can i know if the user is impersonated? this doesn't work gs.getSession().Isimpersonating() i get this error :
Illegal access to getter method isImpersonating in class com.glide.sys.GlideSession
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 02:56 AM
Hi @yoli1
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717055
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 03:00 AM
Hi @yoli1
Let's use this API below to determines whether the current user is impersonating another user.
isImpersonating()
Returns
Type Description
Boolean | True: User is currently impersonating another user. False: User is not currently impersonating another user. |
Sample.
function abortOnImpersonate() {
if (GlideImpersonate().isImpersonating()){
current.setAbortAction(true);
gs.addInfoMessage("Transaction canceled due to Impersonation");
}
return;
}
Cheers,
Tai Vu