User does not have an ITIL role, but still able to access servicenow backend.

nehasr1288
Tera Expert

Hi,

 

I have only given access to service portal to my users and have not given them itil role but still users after they click on 'back' twice in the service portal are able to reach the backend servicenow.How to stop this?

 

find_real_file.png

1 ACCEPTED SOLUTION

You need to delete the script.

 

If you want it specific for Roles you can use below.

addLoadEvent(ESSUserRedirectSP);
function ESSUserRedirectSP() {
	if(g_user.userName != "guest"){
		if(!g_user.hasRoles()){ //This works for users with no role
			var topurl = getTopWindow().location.toString();
			
				var url = "https://" + window.location.host + "/portal_name";
					top.window.location = url;
				}
			}
		}
	}
}

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

View solution in original post

5 REPLIES 5

Yes I know but for deleting the script the admin needs to have access to the backend.I cant delete it from my service portal.I think the below code  should be removed.It is a risk

if(g_user.userName != "guest")