The CreatorCon Call for Content is officially open! Get started here.

How to restrict end users from accessing portals other than the portal they belong to?

Akhil Pendem
Tera Contributor

Hi All,

We've this requirement.

We have 3 customer service portals for 3 companies and an internal portal.

let's consider "/aa" , "/bb" and "/cc" are the url suffixes for the 3 customer portals and the internal service portal with url suffix "/sp".

The portal url would be something like this -- > https://<companydev>.service-now.com/aa. or /bb or /cc
Instance URL is https://<companydev>.service-now.com.

So if an end user 'A' belonging to "/aa" gets curious and removes the url suffix , that'd take the user to the instance UI (which is not desired).

Here comes the requirement:
if the loggedIn user removes the url suffix and clicks enter, the user should be redirected back to the respective portal "/aa". It should be same case if the user 'A', changes the url suffix with "/bb" or "/cc".

 

6 REPLIES 6

Hi Sahana,

I guess that approach is right. We've developed a UI script but it's failing to redirect.
It'd be great if you can recommend some session variables to use in the script. 

 

Thanks!

Akhil

Use g_user.hasRole('admin') to check the roles in if loop.

And use top.window.location = url to redirect to specified url