Restrict switching views

preethigovi
Tera Contributor

Hi Team,

For Non-HR agents, when they search HR case it must land on self service view and that's working fine as per view rule.

But i want to restrict them from switching to other listed views.

i.e, when they try to switch My HR work or any other views it should again revert to self service. Other wise I must remove all the view for them expect self service

Kindly suggest.

preethigovi_0-1732261149624.png

Thank You.

 

5 REPLIES 5

Nasreenfathima
Giga Expert

Hi Preet,

 On load Client script can be written on hr case table ,

   if (!g_user.hasRole(//role which u need to check)) {

 var currView = g_form.getViewName();

if (currView !== 'self_service') {

g_form.setView('self_service');

}}

 

Hope this would help.

Hi @Nasreenfathima , The view is getting set rightly to self service, issue is that i have to remove others views from being visible or restrict switching to other views from self service.

Read ACL can be created on HR Case table, with a condition to check if the user is not an HR role.
if (!gs.hasRole(hr role) && current.view !== 'self_service') {

answer = false;

} else {

answer = true;

}

Mark Manders
Mega Patron

You can remove the role 'view_changer' from their user records.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark