ACL for listview not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 07:06 AM
What I need is an ACL on the list view: users with the x_role should have access to records with the x_type. If they don’t have the role, those types of change requests should not be visible.
I tested this with a user who only has the itil role, and when I impersonate that user, the records are still visible. I need it so that only users with the x_role or the admin role can see those records.
Current ACL:
Type: Record
Operation: Read
Decision Type: Allow if
Name: Change Request
Script:
answer = (current.type == 'x_type') && gs.hasRole('x_role');
I tried also without scripting but still not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 07:16 AM - edited 07-15-2025 07:18 AM
@Abigail the script seems to be incorrect, try something like this:
if (current.type == 'x_type') && gs.hasRole('x_role') {
answer = true;
} else {
answer = false;
}
EDIT: answer = true
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 07:29 AM
Hello @GlideFather
Same result, x_type change requests are still visible when I impersonate a user with only the itil role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 07:41 AM
@Abigail wait wait wait, x_type is a filed to be hidden or its value is a prerequisite to display/hide it?
ACL for your_table.x_type
and scripted condition:
if (gs.hasRole('x_role')) {
answer = true;
} else {
answer = false;
}
//eventually Exactly
if (gs.hasRoleExactly('x_role')) {
answer = true;
} else {
answer = false;
}
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 07:43 AM
@Abigail
or I got inspired from existing records and it could be this one-liner:
- depending on the x_type, i'm not sure what is the meaning of it, based on that:
answer = (gs.hasRole('x_role'));
answer = (current.type == 'x_type' && gs.hasRole('x_role'));
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */