Creating field level acl

MaharshiC
Tera Contributor

Hi,

 

I have a custom table with multiple fields. So I need to create acls such that if the logged in user != planning assigned to then all fields will be read only for him except the "selected item" field. This ""selected item " field can only be edited if the logged in user= executor of the group. How do I create such acl. I have created a record level acl with a script and it is working fine and stopping all users other than planning assigned to to edit but the problem is it is not allowing the executor to edit. I even tried a field level acl for that but stilll not working.

MaharshiC_0-1745403311447.pngMaharshiC_1-1745403361470.pngMaharshiC_2-1745403441013.png

 



1 ACCEPTED SOLUTION

J Siva
Tera Sage

Hi @MaharshiC 

Remove the data condition & add the script condition with below script.

if(gs.getuser() == current.<executer>.sys_id){
answer = true;
}else{
answer = false;
}

Note: Replace the executer with the correct field name.

Regards,
Siva

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@MaharshiC 

you don't require table.* WRITE ACL

is that user passing the table.None WRITE ACL?

If yes then your field level WRITE and table.None WRITE Should allow to edit that field

did you debug using access analyzer?

Any other client script or ui policy is blocking?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@MaharshiC 

also your logic for field level WRITE will work only when Executor field is populated and is not empty

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@MaharshiC 

I believe with condition it should work as well provided the field is not empty

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

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

J Siva
Tera Sage

Hi @MaharshiC 

Remove the data condition & add the script condition with below script.

if(gs.getuser() == current.<executer>.sys_id){
answer = true;
}else{
answer = false;
}

Note: Replace the executer with the correct field name.

Regards,
Siva