Need to hide tabs on a Dashboard when user is dynamic to specific role. Is this possible?

ChristineP
Mega Expert

II have a dashboard for Resource Management and would like to hide some of the tabs from specific roles.  Is there a way to build access controls to tabs within dashboard?

6 REPLIES 6

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

use the following code in a onLoad() script:

var sections = g_form.getSections();
if(g_user.hasRole('itil')){
         sections[1].style.display = 'block';
}else{
         sections[1].style.display = 'none';
}

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Hey Alberto

Hope you can assist, I have a PA widget attached and would like it to dynamically change based on the user logged in or mygroups - is this possible.

 

I have tried this on the filter but nothing seem to work.

 

Assigned to is one of javascript: gs.getUser().getMyGroups().toArray().join()

 

Thank you in advance

Mava

 

This would have to be completed by an Admin correct.  Not sure where to add scripts?

Put the script into an Onload Client Script