Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Landing page based on role

Vimal Priya
Giga Guru

Hi All,

Based on my requirement ,

I have created a new role "end_user" and it does not have have any "contained role " (which has end user access ) .

If the user has 'end_user' role , after logging it has to redirect to the ess page instead it redirects to navpage.do with enduser modules.

1.png

See attached img.

I have modified login rules

1.Users without Roles to ESS :

if(!gs.getUser().hasRoles()&&(gs.getUser().hasRole('end_user')))

gs.setRedirect("/ess");

2.Users with Roles to FrameSet

if(gs.getUser().hasRoles()&& (!gs.getUser().hasRole('end_user')))

  answer = true;

But NO RESULT.

Please help me on this .

1 ACCEPTED SOLUTION

Vimal Priya
Giga Guru

Hi All,



I resoleved by doing the below steps.



1.set false Direct navigation


2.users without roles


if(!gs.getUser().hasRole('admin')||(!gs.getUser().hasRole('itil')))


  answer = true;


(content page \ess)


3.users with roles


if(gs.getUser().hasRole('admin')||(gs.getUser().hasRole('itil')))


  answer = true;


default UI


View solution in original post

6 REPLIES 6

Vimal Priya
Giga Guru

Hi All,



I resoleved by doing the below steps.



1.set false Direct navigation


2.users without roles


if(!gs.getUser().hasRole('admin')||(!gs.getUser().hasRole('itil')))


  answer = true;


(content page \ess)


3.users with roles


if(gs.getUser().hasRole('admin')||(gs.getUser().hasRole('itil')))


  answer = true;


default UI


where do we need to do these changes in which script can you explain need to do something like this