Apply UI policy on group member

athavichith
Mega Sage

Is it possible to show/hide a catalog variable based on if a user is member of group? 

1 ACCEPTED SOLUTION

athavichith
Mega Sage

I ended up creating a role. Applied the role to the group and set the 'Read role' in the variable. 

View solution in original post

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@athavichith Use the script checkbox in the UI Policy and make a GlideAjax call from the UI Policy script to check if the user is member of the group or not. 

 

Screenshot 2025-12-15 at 7.51.48 PM.png

maheshkhatal
Mega Sage
Mega Sage

@athavichith You need to user Client Script(onChange/onLoad depending on the requirement). 

Then using Catalog Client scripts and GlideAjax combination you can achieve this requrement. 

The code that you will write in GlideAjax function will be : 

gs.getUser().isMemberOf('GROUP') method works at server side. You need to execute this via GlideAjax.

 

If this returns true then show the catalog variable and vice versa.

 

Kindly mark my response as helpful if it resolved your doubt.

Thank you,

Mahesh.

athavichith
Mega Sage

I ended up creating a role. Applied the role to the group and set the 'Read role' in the variable.