- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 07:35 AM
Hello
Im getting lost in scripting ACL
What I need is to create ACL where:
User can see only tickets where user is member of group to which ticket is either assigned or watchlisted
Anyone know how to do it?
With the below script Im not getting correct results for READ ACL.
See it below, it should give me back 6 records to read and it giving me back just 3, why ?
please help
/Petr
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 07:59 AM
As noted before, try it with one ACL criteria and two ACLs. Debug the one to determine group membership first. Test it, get it working, etc. If someone comes along later and says "No, we don't need that" it's a simple matter of deactivating it rather than modifying code. Don't pile both bits of logic in one ACL.
ACL 1:
answer = gs.getUser().isMemberOf(current.u_assignment_group.getDisplayValue());
ACL 2:
var result = false;
var list = current.u_support_team_involved.toString().split(',');
for (var i = 0; i < list.length; i++) {
var grp = new GlideRecord('sys_user_group');
grp.get(list[i]);
if (gs.getUser().isMemberOf(grp.getDisplayValue()) {
result = true;
break;
}
}
answer = result;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 09:06 AM
Quick question
Should I better think to create before query business rule? Will it work better then ACL when it comes to rows displayed in the list ?
/Petr

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 08:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 08:59 AM
This is really confusing not only for me but can be as well for others - List is now set to display 50 records and it display just 10
last 1 is displayed on the next page even the list is set to display 50 rows
Thanks to all of you who contributed and spent time with me here to solve this problem. Thanks very much!!!
/Petr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2017 09:04 AM
correct anser as well