Does user need ACL access, even while deleting record through script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 04:26 AM
Hi,
I need to delete a record through a ui action when clicked. In UI action I am calling a script include to delete a record, does the user require ACL delete access even though we are deleting the record from script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 05:13 AM
Hi Sri vyshnavi,
When deleting a record through a script include in ServiceNow, the user executing the script will still need the necessary ACL access to perform the deletion operation. The ACLs associated with the table and the specific record being deleted will be evaluated, and if the user does not have the required delete permissions, the operation will be blocked.
ACLs in ServiceNow define access rights based on roles, so users must have the appropriate roles assigned to them in order to have the necessary delete permissions. If a user executes a script that attempts to delete a record without the required ACL access, an "Access Denied" error will occur, and the deletion will be prevented.
To ensure that users have the necessary ACL access for deleting records through a script include, you should review and configure the appropriate ACLs for the relevant tables and roles. This will enable users with the assigned roles to perform the delete operation as intended.
Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.
Regards,
Shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 08:53 AM
Hi @sri vyshnavi ,
I trust you are doing great.
To implement this solution, you can follow these steps:
Create a UI action that triggers the deletion process when clicked. Specify the appropriate conditions for the UI action to be visible or available.
In the UI action script, invoke the script include responsible for deleting the record. Pass any required parameters, such as the record ID or any additional information.
Within the script include, implement the logic to delete the record using the GlideRecord API or other appropriate methods. Ensure that you perform any necessary validations or checks before deleting the record.
Before executing the deletion logic in the script include, verify that the current user has delete access to the record by checking the ACLs. This validation helps prevent unauthorized deletions.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi