ACL to show a particular field to few groups and users having ITIL role and hide for others

Hemamani Prabha
Tera Contributor

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

 

HemamaniPrabha_0-1722516534461.png

 

Thanks and regards,

Hema

6 REPLIES 6

Ehab Pilloor
Mega Sage

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 

Ayushi12
Mega Sage

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!