Need to create ACLs to restrict the ITIL users to view the attachments.

Pritu
Tera Contributor

Need to create ACLs to restrict the ITIL users to view the attachments. Currently there is no restriction on unauthorized users accessing documents which needs to be restricted

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

on which table?

I am taking example of incident table

you can create a new table level READ ACL on sys_attachment

1) Condition

Table Name = incident

2) Give the role to whom the attachments should be seen

Regards
Ankur

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

Hi,

you can use advanced script in ACL if you don't wish to use roles

answer = !gs.hasRole('itil');

Regards
Ankur

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

Valmik Patil1
Kilo Sage

Hi ,

create read ACL on sys_attachment table and click on advance script check box

and in script section use below script

hideAttachment();


function hideAttachment() {


// if table is incident and user has this role "ITIL" then this acl evaluates to false and attachments will not be visible


if (current.table_name == '<your table name>' && gs.hasRole('ITIL'))


  return false;


}


return true;

Thanks

Valmik