- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 01:03 AM
I have a Client-callable script include with ACLs and an Onload client script of catalog item calls GlideAjax.
Users can see my catalog item in their service portal
- If users pass ACL, they can excute it
- But if an user can't pass ACL, a Javascript error message will show up
Do we have any method to check if user can excute that GlideAjax before execute it? (simular to current.canRead() current.canWrite())
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:05 AM
nope there is nothing for this.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 01:19 AM
Hi @Sominnown ,
Not sure, if there exists any method to check that. But you can, for sure, check the same permissions that are defined in that ACL. For example, if the ACL will pass, given the user has itil role then you can check that in your client script with hasRole() and show a message. If they have it, go call the script include else show a error message. (Itil role was just an example, you can do further checks per your acl).
Hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 01:29 AM
HI @Sonam Tiwari,
Thanks for your reply.
Currently I am using the same way as you suggest.
But in the case of more complex logic, scripting for example, to check that can cause duplicate code 🤔
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:05 AM
nope there is nothing for this.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 02:08 AM
Thanks for confirming @Ankur Bawiskar