Disable attachment remove option for non admins on a custom table

Balaraju K B
Tera Expert

Hi Everyone,

 

I have a requirement to "disable/make it read only" the 'remove' option for Custom table please refer the below screenshot.

BalarajuKB_0-1690804024424.png

And I tried creating the Delete ACL on sys_attachment table with condition as "table name is <custom table name>" and script as if(gs.getUser().hasRole('admin')){

answer = true;

}else{

answer = false;

}

But still not working Is there anything I should update for this in order to work.

 

Thanks in Advance,

Bala

 

 

2 ACCEPTED SOLUTIONS

@Balaraju K B 

Did you debug the security rules from left nav?

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

View solution in original post

@Ankur BawiskarI did Debug security rules but no ACL's were showing up in the debug screen most of them are angular

View solution in original post

11 REPLIES 11

@Ankur Bawiskar I tried using before delete BR as well but how it works is - When the User ticks the checkbox and clicks on Remove button, it appears as attachment is removed (actually its not deleted) but on reload of the form attachment will be visible.

This is not the ideal solution because User thinks that attachment is deleted/removed.

@Balaraju K B 

ACL is the only way then

Did you check which ACL is allowing then?

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

@Ankur Bawiskar How can I identify that particular ACL is allowing delete access?

@Balaraju K B 

Did you debug the security rules from left nav?

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

@Ankur BawiskarI did Debug security rules but no ACL's were showing up in the debug screen most of them are angular