GlideImpersonate is not allowed in Scoped application.

vidyabb
Tera Contributor

We have a requirement to hide the application from the users who are impersonating the custom application users with respective to the specific roles in ACL . But getting an error message that impersonation is not allowed inside scoped application.

 

 

Below is the code :

if (GlideImpersonate().isImpersonating() && gs.getProperty('impersonation_check') == 'true')
answer = false;

2 REPLIES 2

AnubhavRitolia
Mega Sage
Mega Sage

Hi @vidyabb 

 

Please refer below link for further help:

 

https://www.servicenow.com/community/developer-blog/is-not-allowed-in-scope-the-only-workaround-guid...

 

https://www.servicenow.com/community/developer-forum/gs-getsession-impersonate-in-scoped-application...

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

I want to restrict impersonation from admin user to impersonate application users