How restrict row level to users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 07:25 AM
Hi There,
Itil admin can see only inactive incident records only.
How many we can restrict records ?
I know with Before query BR and ACL
Any one suggest me how can I restict with ACL any sample script pls.
Regards
Rajesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 08:23 AM
Hello @Gillerla Rajesh ,
if (gs.hasRole('itil_admin')) { // Check if the user is an ITIL admin
if (current.state != 'active') { // Allow access if the incident is inactive
return true;
}
// Restrict access to active incidents
return false;
} else {
// For non-ITIL admins, use the default ACL rules
return true;
}
If you found my response helpful, please consider marking it as "Helpful" or "Accept Solution." Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 11:23 PM
HI @Soni Tushar ,
it's not working , in return getting some error like retun we can declare in outside the funtion
and also i given answer=true; but that's also not working. can u pls check this code in your side
Regards,
Rajesh Gillerla.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2024 03:24 AM
Hi @Gillerla Rajesh,
Try using answer instead of return in the script and at the end, add return answer.
if (gs.hasRole('itil_admin')) { // Check if the user is an ITIL admin
if (current.state != 'active') { // Allow access if the incident is inactive
answer = true;
}
// Restrict access to active incidents
answer = false;
} else {
// For non-ITIL admins, use the default ACL rules
answer = true;
}
return answer;
If you found my reply useful, please mark it as Solution and Helpful as it will help me and the community.
Thanks and Regards,
Ehab