(ACL) Give a user read/write permission if the user is in the list field.

ESL
ServiceNow Employee
ServiceNow Employee

Hi, I have add a list type field which reference the sys_user table.
I can add some users into the list and let the users in this list able to read/write the record.

There are some OOTB ACL which is allow the user who created the record access the record.

"current.opened_by == gs.getUserID()" 

 

For example, for this "Who can access this record" field, Able, Abraham, Alejandra in this list, I would like let them to access this record.

find_real_file.png

How can I configure ACL by checking list type field? 
Please advice.
Thanks

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

In the ACL script you need something as below

answer=false;
if(current.u_who_can_access.indexOf(gs.getUserID())>-1)
{
answer=true;
}
//replace the field u_who_can_access with correct dictionary name of the field

View solution in original post

6 REPLIES 6

ESL
ServiceNow Employee
ServiceNow Employee

Yes I just wan to know how to create it by script.

Its very helpful.

 

Thanks,

 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can check script mentioned by Jaspal

Regards
Ankur

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