How to Avoid GlideRecord in ACL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I did but the ask is not to move to script include and only way left is to do with ACL conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
then not possible directly.
Use this approach
1) create custom field of type List referring to sys_user
2) store the approvers of that RITM in it
3) then use this in ACL condition
💡 If my response helped, please mark it as correct ✔️ and close the thread 🔒 — this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
@Snehal13 what is datatype of ?
current.request.approvers
you can verify with below code.
(function() {
answer = false;
// Ensure we have a parent request and an approvers list
if (current.request && current.request.approvers) {
var approvers = current.request.approvers + ''; // force to string
if (approvers.split(',').indexOf(gs.getUserID()) > -1) {
answer = true;
}
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
tried but didnt work