Redirection of Portal not for an admin role.

Vishwas Kulkarn
Tera Contributor

Hello, I want to redirect users with itil role but not admins to specific portal. Please find below code of mine.

 

var rl = gs.getSession().getRoles().includes('itil');
        if (!rl && !redirectURL && !isServicePortalURL)
            return;
 
Thank you.
11 REPLIES 11

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

What is the issue you are having?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Vishwas Kulkarn
Tera Contributor

Hi @Mark Roethof , now admins are also redirected to the portal.

So your question is that this is working code, though you would like to enhance it, so that admins are exempt of this? 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

yes, right now code is working but for all because admins also have itil role.