- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 03:45 AM - edited ‎09-11-2024 03:46 AM
I want to restrict users with certain roles from viewing incident_list.do. I mean, when they hit this URL, they should not be shown the records and be redirected to workspace. How can I achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 03:57 AM
Hi @Dhana3 Try to create a Before Query BR on Incident table and add below code and modify accordingly
(function executeRule(current, previous /*null when async*/) {
if (gs.getUser().hasRole('role_to_restrict')) {
gs.addInfoMessage('You do not have permission to view this page.');
gs.getUser().redirect('/workspace');
gs.setRedirect('/workspace');
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 03:57 AM
Hi @Dhana3 Try to create a Before Query BR on Incident table and add below code and modify accordingly
(function executeRule(current, previous /*null when async*/) {
if (gs.getUser().hasRole('role_to_restrict')) {
gs.addInfoMessage('You do not have permission to view this page.');
gs.getUser().redirect('/workspace');
gs.setRedirect('/workspace');
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2024 01:21 AM
Hi Sid,
Thank you. This solution works. Can you please suggest any other solution for instead of redirecting, if I just want to restrict the user. Can this be achieved through ACL?