I've created an ACL on sys_attachment table to restrict the attachment to specific users but it is affecting the attachments on relative record producer too
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2016 08:28 AM
The following is the small script I've written on sys_attachment table to restrict the read-access of those attachments for a specific table to the assigned person but the record producer that is creating records on the table (u_capital_workflow'), is being affected as it is stopping the users to attach an attachment such as it is not showing as no attachments even after they attached something.
if(current.table_name == 'u_capital_workflow'){
var gr = new GlideRecord("sn_sm_finance_task");
gr.addQuery("parent", current.table_sys_id);
gr.query();
if (gr.next()) {
if(gr.assigned_to == gs.getUserID()){
answer = true;}
else{
answer = false;}
}
}
else{
answer = true;
}
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 07:47 AM
Have you looked at a client script on the form using g_form.disableAttachments() instead of the ACL? That would leave it intact for the record producer, but disable adding/removing attachments from the form.
GlideForm (g form) - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 08:11 AM
Yeah but that just disables the users to attach new attachments but wouldn't restrict the users to read the existing attachments right?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2016 08:14 AM
Have you thought about using a condition like:
if (current.isNewRecord()...
in your ACL? That may help determine whether you are creating a new record (from a record producer) or editing an existing one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2016 10:10 AM
This seems a reasonable idea, I'll have to try this. Thank you so much.