How we can disable delete operation in all of the servicenow tables

Shreya Nagar Na
Tera Contributor

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 .

6 REPLIES 6

Community Alums
Not applicable

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

 



SandeepDutta_0-1709102320668.jpeg

 

 

Harish Bainsla
Tera Sage
Tera Sage

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

Shreya Nagar Na
Tera Contributor

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 .

 

Maddysunil
Kilo Sage

@Shreya Nagar Na 

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