- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 05:23 AM
I have an ACL on sc_req_item table as below to allow read access to the RITM for sc task approvers.
How to remove GlideRecord usage in ACL and replace with ACL conditions so that it still grants read access to the RITM and variables on it for sc task approvers
var app_obj = new GlideRecord('sysapproval_approver');
app_obj.addQuery('approver', gs.getUserID());
app_obj.addQuery('sysapproval', current.sys_id);
app_obj.query();
if (app_obj.next()) {
return true;
}
return false;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 05:30 AM
not possible directly using condition as RITM table doesn't hold approver info
You can move code to Script include and call that in ACL script and you should be good.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 05:30 AM
not possible directly using condition as RITM table doesn't hold approver info
You can move code to Script include and call that in ACL script and you should be good.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 05:47 AM - edited 10-08-2025 05:48 AM
Replace
if (app_obj.next()) {
return true;
}
return false;by
return app_obj.hasNext();It's bit more performant as it only checks if there's a record found and doesn't retrieve it, and a bit more performant can matter when running across all your RITMs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 06:31 AM
I want to completely remove GLideRecord from the ACL and only do with something using
current.request.approvers || current.request.approvers.split(',').indexOf(gs.getUserID()) > -1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2025 06:35 AM
Did you check my response which I shared above 1hr ago?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
