Why following catalog client script working only for admin user?

Sachin G K1
Kilo Sage

Hi All,

I am check if user is part of group "application development" then it should hide data card checkbox. Following script working only for admin users. Please help!

Script Include:

SachinGK1_0-1708233708284.png

Catalog client script:

SachinGK1_1-1708233726478.png

 

 

Abel Tuter without admin role(Can't see result of script include):

SachinGK1_2-1708233962618.png

 

Abel Tuter with admin role(Can see results of script include):

SachinGK1_3-1708234055089.png

 

Thanks in Advance

1 ACCEPTED SOLUTION

Hi Sachin,

 

My bad...can you try updating isPublic function return true

 

/*is Public function*/
isPublic:function(){
return true; //updated
},

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

5 REPLIES 5

Vishal Birajdar
Giga Sage

Hello @Sachin G K1 

 

It might be because of access issue with script include.

Can you try adding this function in your script include & then try :

 

/*is Public function*/
isPublic:function(){
return false;
},

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

I tried it didnt work

Hi Sachin,

 

My bad...can you try updating isPublic function return true

 

/*is Public function*/
isPublic:function(){
return true; //updated
},

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Yes, its working now, can you please explain why itsn't working first and what this function do and how did this helped here