- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:23 AM
Hi Experts,
I want to create a UI policy to show few fields to users from particular groups. Please suggest how should I approach it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:32 AM - edited 06-08-2023 01:33 AM
Hi @saint
UI policy would not be the right choice for what you are trying to achieve if they are not stored in some field of the form
Please create a read ACL for those fields and you can write script in ACL to only allow users of particular groups as done below
if(gs.getUser().isMemberOf(group_name/group_sysid) || gs.getUser().isMemberOf(group2_name/group2_sysid))
{
answer= true;
}
else
{
answer=false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 03:22 AM
No, Not possible in ACL
An alternate approach would be to write a on load client script and it can work for a particular view.
You can use GlideAjax and call a script include from client script to check if logged in user is member of certain group .Based on the result returned by Script Include, you can show or hide fields on the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 03:40 AM
Alternatively I was thinking the same just of using the SI withing the UI action script. Let me give it a try with both the cases. Thanks