- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 12:44 PM
I'm trying to be able to validate if the user has the business_stakeholder role to send it straight to the Service Portal page and if is someone else go to the respective frontpage like admins or ITILs to the IS View and who doesn't have a role to go to the Service Portal.
Found another Question related to this and shows that I have to change this in the script SPEntryPage:
The Initialize function adding the validation of the stakeholder and setup the default page to the Service Portal.
initialize: function() {
this.logVariables = false; // for debugging
if (user.hasRole("business_stakeholder"))
this.portal = "/sp/"; // Set the URL to the Service Portal
else
this.portal = this.getDefaultPortal(); // The URL suffix for default portal
},
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 12:59 PM
I would return the initialize function to only for the portal page...
initialize: function() {
//this.logVariables = true; // for debugging
this.logVariables = false;
this.portal = "/sp/"; // The URL suffix specified in the sp_portal record
},
and then check to be sure the returnURL variable is defined to this.portal.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 01:31 PM
Hello Jesus,
Try just setting the admin and itil roles in the 'getFirstPageURL' section of the SPEntryPage script include, like:
if ((user.hasRole('admin') || user.hasRole('itil')) && !redirectURL && !isServicePortalURL)
return;
Any other role should then redirect to the portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 12:44 PM
It didn't work. it always go to the IS View instead of the Home Service Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 12:59 PM
I would return the initialize function to only for the portal page...
initialize: function() {
//this.logVariables = true; // for debugging
this.logVariables = false;
this.portal = "/sp/"; // The URL suffix specified in the sp_portal record
},
and then check to be sure the returnURL variable is defined to this.portal.