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 08:50 AM
Can you provide context on what your ACL is granting access to? Without that context, it'll be hard to suggest an improvement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 01:24 AM
Hi Kieran,
The ACL was to provide read access to the approvers for custom table based on the requests they have to approve.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 09:28 AM
The following can be used in a table read ACL
answer = (new global.ApproverUtils()).verify(current.getTableName(), current.getUniqueValue(), gs.getUserID());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 09:09 AM - edited 02-17-2025 09:14 AM
Hello,
I assume you posted script of write ACL for sysapproval_approver record. Look for existing out-of-box ACL which does the same thing:
SysID: 80d52d76c0a8016654604f17e7afb1da
Script:
answer = gs.hasRole('approval_admin') || gs.hasRole('itil') || gs.hasRole('catalog') || (new ApprovalDelegationUtil().isMyApproval(current));
If my answer helped you, please mark it as correct and helpful, thank you 👍
Martin