gs,getUserId returns wrong value in ACL while impersonating
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello Guys,
I'm trying to check if the Requested by user is the same loggedIn user so i checked this in the ACL but gs.getUserID returns my ID not the impersonated user
here's the code :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
don't try to test ACL with impersonation.
Try to clear instance cache and then impersonate
Did you check with actual user?
it should give the correct logged in user sysId
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hello @Ankur Bawiskar ,
thanks for your support.
but i did this already and still get my ID instead of the impersonated user so i just need to check if the cases created by person is the same loggedIn user, is there anyway?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I already informed don't test by impersonating.
Try to login with actual user
You already must be having some test users in your DEV instance for which you must be knowing the password as an admin
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
