Read ACL should not have GlideRecord/GlideAggregate/GlideRecordSecure in script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 10:07 PM
Hello All,
Hope all are doing good !!
ACLs (Security rules) should not have GlideRecord/GlideAggregate in script
We have a custom ACL written as shown below using GlideRecord. How can i replace this code so that it does not use GlideRecord query. or is it even possible in this case?.
Regards,
Prity
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 10:10 PM
Hi @prityshawex
Have this logic in the script include and call the script include from the ACL script.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 10:43 PM
Yes it's not recommended to use GlideRecord, GlideAggregate in ACL script as per best practices.
Try this
1) see if you can handle the above in conditions directly
OR
2) create a script include and then call it from your ACL script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
How does moving the GlideRecord into a Script Include solve the problem?
From a system perspective, isn’t the ACL evaluation exactly the same when we call the Script Include?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
that's correct.
It still calls and evaluates but that's what how the scan is bypassed in case we wish to solve the requirement.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
