- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 06:50 AM
Hello Experts,
I have to restrict the visibility of the incident records in list view through ACL if logged-in user is not part of location in incident.
We have a custom field u_location on incident , Suppose there are 100 incidents out of which 10 incidents has location as "Canada" and if logged in user is part of Canada location then that user should see only 10 incidents not 100 in incident list view
We have below script in Read ACL, It is table level Table.None
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2025 02:02 AM
Hello @Vijay Baokar
You can create before query business rule to achieve this requirement
(function executeRule(current, previous /*null when async*/ ) {
if (!gs.hasRole("admin")) {
var user = new GlideRecord('sys_user');
user.addQuery('sys_id', gs.getUserID());
user.query();
if (user.next()) {
var userlocation = user.location;
}
current.addQuery("u_user_location=" + userlocation);
}
})(current, previous);
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 07:00 AM - edited 03-21-2025 07:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 07:22 AM
Hello @Vijay Baokar
Add another table.* (All the fields) Level ACL. You must have seen there is "Deny Unless" after Xanadu. Here Deny condition is evaluated first. So add this as well in all the field ACLs on incident table.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 07:33 AM
Hii @Vijay Baokar ,
you can achieve it through before query business rule
can you try this and let me know if it works or not before and query business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2025 02:02 AM
Hello @Vijay Baokar
You can create before query business rule to achieve this requirement
(function executeRule(current, previous /*null when async*/ ) {
if (!gs.hasRole("admin")) {
var user = new GlideRecord('sys_user');
user.addQuery('sys_id', gs.getUserID());
user.query();
if (user.next()) {
var userlocation = user.location;
}
current.addQuery("u_user_location=" + userlocation);
}
})(current, previous);
Thank You!