users only able to see to self service view

Community Alums
Not applicable

Hi Connection,

 

I have issue for many users where users are only able to view self-service portal, is that a role base issue or AD integration issue or any ACL issue or any other.

 

Rafmine_0-1703652564040.png

 

Appreciate your help!

 

Best Regards,

Rafmine.

4 REPLIES 4

Sainath N
Mega Sage
Mega Sage

@Community Alums : Does users have only ‘snc_internal’ role?

 

users with snc_internal roles gets redirected to portal by default 

 

All the portal redirections are controlled by the script include. Please refer the HI article if that helps.

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0746730

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

 

Community Alums
Not applicable

Hi sainathnekkanti,

 

Yes users only have snc_internal role only .

 

if you have time can you plz help me with the issue , its pending for long time and client is behind me...

Re: Issue with AD Integration Synchronization - He... - ServiceNow Community

 

Best Regards,

Rafmine.

@Community Alums : That’s the standard behavior that end users has only portal access during login.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Community Alums
Not applicable

Hi Sainathnekkanti,

 

below is the script include script, can you tell me if any thing is stopping the user access.. 

 

/** 
 *
 *  Service Portal sample script include to indicate 
 *  1. which login page should be used
 *  2. the starting page after the user is authenticated 
 * 
 *  Script is configured using system properties
 
 *  PROPERTY                        VALUE
 *  glide.entry.page.script         new SPEntryPage().getLoginURL(); 
 *  glide.entry.first.page.script   new SPEntryPage().getFirstPageURL();
 * 
 * functions can return a path or null if no overrides are necessary
 * 
 **/
var SPEntryPage = Class.create();
 
SPEntryPage.prototype = {
 
initialize: function() {
this.logVariables = true;  // for debugging 
this.portal = "/ssp/";      // The URL suffix specified in the sp_portal record
},
 
/***
*
* Referred to by property: glide.entry.page.script
**/
getLoginURL: function() {
// When requesting a page directly (eg: /problem_list.do)
// The platform session_timeout.do sets the login page to welcome.do
// Since we are handling the login, clear that value
var session = gs.getSession();
var nt = session.getProperty("nav_to");
var sPage = session.getProperty("starting_page");
if (nt == "welcome.do")
session.clearProperty("nav_to");
 
if (!sPage && !nt)
session.putProperty("starting_page", gs.getProperty("glide.login.home"));
 
// Send the user to the portal's login page
var portalGR = new GlideRecord("sp_portal");
portalGR.addQuery("url_suffix", this.portal.replace(/\//g, ""));
portalGR.addNotNullQuery("login_page");
portalGR.query();
if (portalGR.next())
return this.portal + "?id=" + portalGR.login_page.id;
//return "/navpage.do";
// Send to the a default login page
return this.portal + "?id=login";
// return "/navpage.do";
},
 
/***
*
* Referred to by property: glide.entry.first.page.script
**/
getFirstPageURL: function() {
var session = gs.getSession();
this.logProperties('before', session);
 
// has roles and is not a Service Portal page - go to UI16
var nt = session.getProperty("nav_to");
var isServicePortalURL = new GlideSPScriptable().isServicePortalURL(nt);
var redirectURL = session.getProperty("login_redirect");
var rolename, nonenduser, enduser;
var userbu_role = new BuConfigUtils().getMyBUName();
var gruser = new GlideRecord('sys_user_has_role');
gruser.addEncodedQuery('user='+gs.getUserID());
gruser.query();
var userrrolecount = gruser.getRowCount();
var count = 0;
var test;
while(gruser.next())
{
rolename = gruser.role.name;
//gs.log("role name is"+rolename);
if(rolename == 'approver_user' || rolename == 'workday_users' || rolename == 'certification' || rolename == userbu_role || rolename == 'snc_internal')
//enduser = "true";
{
count = 11;
//gs.log("counter is first"+rolename);
}
 
else if((rolename != 'approver_user' && rolename != 'workday_users' && rolename != 'certification' && rolename != userbu_role))
{
count=100;
test = "true";
//gs.log("counter is inside"+rolename);
break;
}
 
// nonenduser = "true";
}
//gs.log("counter is last"+count);
 
 
if((user.hasRoles() && count==100 && userrrolecount>1 && test == "true") && !redirectURL && !isServicePortalURL)
return;
 
else
this.portal = "/ssp/";
// user may have logged in from a frame, the /login_redirect.do page will bust out of it
if (!redirectURL) {
// redirectURL is nav_to 
// if nav_to == "welcome.do" then use starting_page
var sPage = session.getProperty("starting_page");
if (sPage && nt == "welcome.do")
nt = sPage;
 
// Avoid a redirect loop to the home page
var ep = gs.getProperty("glide.login.home");
if (nt) {
if (ep == nt)
nt = null;
}
// PRB726860: if page is still welcome.do, go to glide.login.home preserving frameset
if (nt == "welcome.do") {
session.putProperty("nav_to", ep);
return;
}
 
session.putProperty("login_redirect", nt || "true");
return "/login_redirect.do?sysparm_stack=no";
}
 
session.clearProperty("login_redirect");
var returnUrl = this.portal;
if (redirectURL && redirectURL != "true") {
var spUrl = new GlideSPScriptable().mapUrlToSPUrl(redirectURL);
returnUrl = spUrl ? this.portal + "?" + spUrl : redirectURL;
}
 
this.logProperties('after', session);
if (!this.logVariables) {
//gs.log('redirectURL: ' + redirectURL);
//gs.log('User: ' + user.getName());
//gs.log('is internal: ' + (!user.hasRoles()));
//gs.log('returnUrl: ' + returnUrl);
}
 
return returnUrl;
},
 
logProperties: function(beforeOrAfter, session) {
if (!this.logVariables)
return; 
 
//gs.log('SPEntryPage: Redirect ------------------------------- ' + beforeOrAfter);
//gs.log('session.starting_page: ' + session.getProperty("starting_page"));
//gs.log('session.nav_to: ' + session.getProperty("nav_to"));
//gs.log('session.login_redirect: ' + session.getProperty("login_redirect"));
//gs.log('gs.fURI: ' + session.getURI());
},
// added by NJ
setMobileUITheme: function(){
// var userbu = new BuConfigUtils().getMyBU();
// var themesysid = new GlideRecord('sys_ui_mobile_theme');
// themesysid.addEncodedQuery('u_business_unit='+userbu);
// themesysid.query();
// if(themesysid.next())
// {
// gs.log("testyi is"+themesysid.sys_id);
// return themesysid.getUniqueValue();
// }
// else
// {
// var session = gs.getSession();
return gs.getProperty('shv.ipragaz.mobile.ui.theme.sysid').toString();
 
 
},
type: 'SPEntryPage'
};