- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 04:52 AM
Hi Everyone,
I have a requirement to "disable/make it read only" the 'remove' option for Custom table please refer the below screenshot.
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 05:47 AM
Did you debug the security rules from left nav?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 07:03 AM
@Ankur BawiskarI did Debug security rules but no ACL's were showing up in the debug screen most of them are angular
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 05:21 AM
Hi @Balaraju K B ,
I think the condition field in an ACL should be a GlideFilter or a standard query that evaluates to true or false.
Using "table name is <custom table name>" directly as the condition will not work.
condition -
current.table_name == 'custom_table_name' && !gs.hasRole('admin')
script can be something like this -
answer = current.table_name != 'custom_table_name' || gs.hasRole('admin');
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Regards,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 05:25 AM - edited 07-31-2023 05:26 AM
@Tushar We cannot use current.table_name in the condition as its a dropdown filter.
Thank you for the reply,
Bala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 05:29 AM
@Ankur Bawiskar Any solution for this to restrict the Deletion of the attachment for non admins on a specific table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 05:32 AM
if the user has write access to your table then user can add/remove the attachment
Why not use before delete BR on sys_attachment table then?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader