How to condition ACL based on user session origin (ESC/Workspace/...)

AijaRe
Kilo Sage

Hi all!
I need to implement an ACL based on the origin of the call.. in my case, if user is accessing table while using Employee Center, the ACL should return false, and otherwise true.

Is there a method in SN that would return the origin of the access?
I tried to use gs.action.getGlideURI(), but when I'm in "/esc.." it returns "api/now/sp/widget/..." so I'm not sure how reliable it is to use this method.
I tried also gs.getSession().getUrlOnStack(), but it returns null.

In this particular case I'm interested to check if the user is using Employee Center, but would be good to know how to do this check for other origins.

Appreciate any feedback!
Thank you!

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@AijaRe 

not at all reliable "gs.action.getGlideURI()"

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi, @Ankur Bawiskar , what would you suggest to distinguish the access origin in an ACL?

@AijaRe 

very difficult to rely.

but ideally it's not a valid business requirement to allow or deny access based on origin.

Please inform this to your customer.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@AijaRe 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader