How we can disable delete operation in all of the servicenow tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:35 PM
Updating the role as an admin for all delete operations in the ACL is possible, but it is not a straightforward approach. Is there a simpler way to ensure that only admin can delete records from all tables?
1. Only admin can delete record no one else can delete any record in any table .
2. Its a global change not limited to any specific table .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:38 PM
Hi @Shreya Nagar Na ,
Have table level ACL for delete and give correct role for that. such as admin etc. based on your requirement.
Users with that role can delete the records.
ACL - Table level means table None
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:47 PM
Hi use ACL
The ACL Approach (Access Control Lists): ServiceNow's security model offers a far more targeted and effective way to control deletions:
Roles and Permissions: Define granular roles with specific 'delete' permissions on individual tables.
Conditions: Implement conditions within ACLs to restrict deletions based on criteria like record state, user groups, or specific fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:48 PM
My requirement is that only the admin should be able to delete records from all tables. My approach involves updating the role to 'admin' for all delete operations in the ACL. While this is possible, it may not be the most straightforward method. I am looking for a simpler way to achieve this .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 10:53 PM
I think the only way is to write Delete ACL:
- Set the "Operation" to "Delete".
- Leave the "Name" field blank to apply this rule globally to all tables.
- In the "Script" field, enter the following script:
// Allow delete only for users with the admin role
if (!gs.hasRole('admin')) {
answer = false;
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks