How to Create ACL for Assignment Group.

venkysana
Tera Expert

if Incident is Assigned group is CapGemini then the CapGemini Group members can write or edit the incident. If anyone opens that ticket who is not a member of CapGemini Group then they can't edit that ticket.

How to Achieve this with ACL?

1 ACCEPTED SOLUTION

Hi,

then you can use this logic and don't use ACL

Display BR: On incident table

g_scratchpad.isMember = gs.getUser().isMemberOf('CapGemini');

Client script: on incident table

function onLoad(){

	if(g_scratchpad.isMember.toString() == 'false' && !g_form.isNewRecord()){
		var fields = g_form.getEditableFields();
		for (var x = 0; x < fields.length; x++) {
			g_form.setReadOnly(fields[x], true);
		}
	}
}

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

ACLs are the recommended way

1) table level WRITE ACL

2) Advanced script checkbox true

3) Script

answer = gs.getUser().isMemberOf('CapGemini');

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Please Check my Acl Is is Correct?

Hi,

Script looks fine

please test with the user who is member of that group

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thank you Sir,

Its working fine but I got some issues. some fields are not changed to read-only. 

Please Check my attached screen shot.