ACLs / Security rules should not have GlideRecord/GlideAggregate in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 12:38 AM
Hi,
I want to avoid database lookups in Access Control rules. Please check the below script. Can we update the code differently (without GlideRecord queries)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 09:13 AM
HI @Swarnalathay ,
Create a server-callable Script Include and move the logic you've written in the ACL script to this Script Include. Then, call the Script Include in the ACL. This approach will help avoid performance concerns and enable you to achieve your requirement without the need for database lookups in the ACL.
This is the best practice as suggested by ServiceNow.
Please mark my answer as correct/helpful if it solves your query.
Best Regards,
Pooja

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 09:22 AM
Hi Pooja,
That isn't correct. Although moving the logic to a script include will help in centralising the script, the same performance concerns are present and a database lookup is needed