Restrict attachments to itil users only

sree42
Tera Contributor

Hi Team,

I have one requirement to visible attached attachments in incident table should be visible to itil users only similar to work notes visible in servicenow. Could anyone please suggests how can we achieve this?

 

I wrote one read al for itil user for sys_attachments table. But it is not working a expected.

3 REPLIES 3

Amit Gujarathi
Giga Sage
Giga Sage

HI @sree42 ,
I trust you are doing great.

  1. Create a new field in the Incident table to store the visibility information. Let's call it "ITIL Visible."

  2. Define the field as a checkbox type to represent visibility.

  3. Next, you need to modify the read ACL (Access Control List) for the sys_attachments table to restrict access to ITIL users only. This ACL controls who can read the attachments.

  4. To do this, navigate to "System Security" > "Access Control" > "Tables" and search for "sys_attachments" table.

  5. Open the ACL for the sys_attachments table and add a new condition to check if the current user has the ITIL role. The condition should be similar to:

 

gs.hasRole('itil')

 

  • Save the ACL and test it by logging in with an ITIL user and attempting to view attachments in the Incident table.
  •  

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



Manmohan K
Tera Sage

Hi @sree42 ,

 

Write an on load client script with below code

function onLoad() {
 
    if (!(g_user.hasRole('itil')))
        gel('header_attachment').style.display = 'none';
}

 

Manmohan K
Tera Sage

@sree42 ,

 

Make sure that isolate script is unchecked in client script

 

ManmohanK_0-1684928521861.png