ACL

RuchaG
Kilo Contributor

i want to create an acl that allows only people of comment_editor group to edit the comments field and it should not affect admin roles

3 REPLIES 3

pratikbhatt
ServiceNow Employee

Create a deny unless on the comment field with the comment_editor role, and then create one more allow-if with the same role. Make sure you keep admin override true for both ACLs. 

Its_Azar
Mega Sage

Hi there @RuchaG 

 

create an ACL

answer = gs.hasRole('admin') || 
         gs.getUser().isMemberOf('comment_editor');

Keep Admin overrides = true so admins are not affected.

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,
Azar
Serivenow Rising Star
Developer @ KPMG.

pratikbhatt
ServiceNow Employee

Skip the scripted ACL here — it's not needed. Default to non-scripted ACLs and only reach for a script when there's no other way. Non-scripted ACLs evaluate once; scripted ACLs evaluate per record, so dropping unnecessary scripts gives you a real performance win.