restricting incident_list.do

Dhana3
Kilo Sage

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?

1 ACCEPTED SOLUTION

Sid_Takali
Kilo Patron
Kilo Patron

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);

 

View solution in original post

2 REPLIES 2

Sid_Takali
Kilo Patron
Kilo Patron

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);

 

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?