- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 11:07 PM
Hi everyone,
Does GlideRecordSecure
apply ACLs only when we try to access the records? I was trying to get the top 5 records from a table that should have read access. However, when I added the set limit to the query, it retrieved the top 5 records that included the ones which failed the ACLs as well. It seems the ACLs are being applied only when we access the record. In the below code snippet after the query the getRowCount is 5 but after adding the records to the array the length is 2 as the user have access to only those 2 among the 5 records. But the intention here was to show all the 5 accessible records where 5 is the recordsearchlimit.
Thanks,
Suchitha.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 12:10 AM
If the main issue is to stop processing records after some limit is set, you do a workaround with a counter variable, that stops the processing after a given number of records have been added to the array.
And yes, retrieving all records is of course slower than retrieving a small number of records, so it will affect performance in a way, but all this is happening in the backend, so the impact to the user is not so big.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 11:51 PM - edited 07-11-2024 11:53 PM
Hi,
This kind of makes sense, the ACL is evaluated when you are performing an action (such as trying to read the record).
You can easily work around this by adding an extra check, like below:
if (yourGlideRecordObject.canRead()){
// perform logic here
}
before adding the items to the array.
Then you will only get records available as per ACL permissions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 12:00 AM
Thanks for the quick response. But how do we accommodate set limit in that case. If I remove set limit and get all records later check for canRead would't that impact the preformance?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 12:10 AM
If the main issue is to stop processing records after some limit is set, you do a workaround with a counter variable, that stops the processing after a given number of records have been added to the array.
And yes, retrieving all records is of course slower than retrieving a small number of records, so it will affect performance in a way, but all this is happening in the backend, so the impact to the user is not so big.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 12:41 AM
Thank you!