Respecting ACLs in GlideAggregate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2020 11:42 AM
I have a ServicePortal widget which calculates a set of filtered record counts using GlideAggregate.
Is there a way, like GlideRecordSecure to make the aggregate respect the ACL on the table and only count records which the logged in user can see? It seems crazy to have to replicate the same ACL logic in the aggregate query filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2024 07:57 AM
no, it is not

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2022 09:05 PM
No, you'll have to use GlideRecordSecure in your widget server script.
var grs = new GlideRecordSecure('your_table');
//your query here
grs.query();
data.count = grs.getRowCount()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2022 11:03 AM
Hey Kit, even with GlideRecordSecure, all records are returned from the query and getRowCount will return the total, including records that are not read-able by the user. The records are only skipped during the .next() iteration if they are not read-able. You would need to add a custom counter like so:
var grs = new GlideRecordSecure('your_table');
//your query here
grs.query();
var total = 0;
while (grs.next()){
total++;
}
data.count = total;