ACL to show a particular field to few groups and users having ITIL role and hide for others
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 05:49 AM
Hello all,
Can someone help me how to write ACL for the below condition in incident table.
I have created a new field (checkbox) in incident type and only certain users should be able to check this while for others this field should not be visible.
ACL--> Assignment group(of that incident), Service Management, any group with role itil or role incident_itil should be able to check flag, update fields and save INC
Thanks and regards,
Hema
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:27 AM
Hi @Hemamani Prabha,
If you want to make whole record visible and editable for specific groups and roles, then make a read and write ACL for incident.* and in roles visibility, add required roles and you can write a script for Groups
if (gs.getUserID().isMemberOf('Service Management' ) || gs.getUserID().isMemberOf(current.assigned_to)){
answer=true;
} else {
answer=false;
}
If you found my response useful, please mark it as Solution and Helpful as it will help me and the community.
Thanks and Regards,
Ehab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:53 AM - edited 08-01-2024 07:54 AM
Hi @Hemamani Prabha
You can create a read and a write access control at the field level (i.e., incident.u_checkbox) in incident table and can refer to below script.
if (gs.getUser().hasRole('itil') ||gs.getUser().hasRole('incident_itil')) {
answer = true;
} else {
if( gs.getUser().isMemberOf('current.assignment_group') ||gs.getUser().isMemberOf('name of group'));{
answer = true;
} else {
answer = false;
}
}
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks!