How to check if user can Execute a client-callable script include

Sominnown
Tera Contributor

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

Sominnown_0-1693209528890.png

Sominnown_1-1693209550752.png

 

Do we have any method to check if user can excute that GlideAjax before execute it? (simular to current.canRead() current.canWrite())

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Sominnown 

nope there is nothing for this.

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

View solution in original post

5 REPLIES 5

Sonam Tiwari
Tera Guru

@Sominnown ,
I see what you are saying. Even though it saves us from calling script include in unfavourable cases thus saving the whole execution. In the favourable one, its going to be a duplicate execution.