- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:03 AM
Hi
I need to write ACL to read all the incidents of logged in user own incidents and if he is mentioned in watchlist and incidents of all groups he/she is memberof.
Thank You.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:18 AM
Hi @Raviteja Kunal1, can you try below in ACL script?
var userId = gs.getUserID();
var canUserAccess = [current.opened_by.toString(), current.opened_for.toString(), current.watch_list.toString()];
answer = canUserAccess .indexOf(userId) > -1 || gs.getUser().isMemberOf(current.assignment_group);
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:18 AM
Hi @Raviteja Kunal1, can you try below in ACL script?
var userId = gs.getUserID();
var canUserAccess = [current.opened_by.toString(), current.opened_for.toString(), current.watch_list.toString()];
answer = canUserAccess .indexOf(userId) > -1 || gs.getUser().isMemberOf(current.assignment_group);
Regards,
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:39 AM
Hi Sunil
Still I am able to see only own incident not group incidents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 08:53 AM
HI @Raviteja Kunal1 ,
if (gs.getUser().isMemberOf(current.assignment_group) || current.watch_list.indexOf(gs.getUserID()) > -1) {
answer = true;
} else if (current.u_group_watch_list.toString().length > 0) {
var myGroups = getMyGroups().toArray();
for (var i=0; i < myGroups.length; i++) {
if (current.u_group_watch_list.toString().indexOf(myGroups[i]) > -1) {
answer = true;
break;
}
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda