Add EncodedQuery to an ACL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 01:00 PM
Hi.
Instead of a Business Rule, how can I add an encoded query to an ACL?
Let's say, if the logged in user has a certain role, he can only access HR cases created in the past month.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 01:09 PM
Hi, ACL's return a true\false result and so your encoded query needs to be via a scripted glide-query against the records table, normally this would return true when if(yourQuery.next()) condition check IE if your glide-query returned a result. My personal preference is to use a script-include and call the function, so that code can be reused\utilized as refqual, ACL or QBR.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2022 01:12 PM
Hi,
Encoded Query is not required in this case instead you can specify the role in the Roles embedded list in and in the condition try something like this created before current month and in the script section try answer = gs.hasRole('SPECIFY_ROLE_HERE');
Regards,
Muhammad
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2022 08:10 AM
I managed to add the filters on to the endpoints instead of doing any validation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2022 10:12 PM
A filter may 'hide' the records from certain views but it may not be a secure solution and your users could potentially still see the records for reports or by navigating to tables directly IE task.list in the filter navigator.
As Muhammad mentioned above, using role based ACL's is also a good option.