Redirect users to SOW if they have business_stakeholder role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 10:31 PM
Hi,
If the user has roles itil or business_stakeholder, he needs to redirect to backend homepage when he logged in. I gave Abel Tuter the business_stakeholder role and when he logged in it says show that the url is:
my_instance_url/now/sow/home
and it shows:
403: You do not have permissions to access this page.
how can I fix this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 11:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 11:07 PM
Hi @Alon Grod
I think there might be an ACL or other restrictions on the page (/now/sow/home
) preventing users with certain roles from accessing it.
- Can you please search for any ACLs related to the
/now/sow/home
page. - Also, check that the roles
business_stakeholder
is allowed to access this page or resource. If not, you may need to modify or create an ACL for the page to allow these roles.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 11:47 PM
@Tushar @Ranjit Nimbalka
I have the sys_property glide.login.home to be set to /now/sow/home.
I need that users with business_stakeholder role will be redirect to dashboard page in native ui.
I tried to adjust the SPEntryPage script include and I added this:
if(user.hasRoles('busines_stakeholder')){
gs.log('abel');
var instanceURL = gs.getProperty("glide.servlet.uri");
return instanceURL + "now/nav/ui/classic/params/target/%24pa_dashboards_overview.do";
}
The problem is that Im not getting the log and users always refer to now/sow/home
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 01:22 AM - edited 11-18-2024 01:23 AM
Hi @Alon Grod
can you please try with below
// Check if the user has the business_stakeholder role
if (gs.getUser().hasRole('business_stakeholder')) {
gs.log('User is a business stakeholder, redirecting to the dashboard...');
// Get the instance URL
var instanceURL = gs.getProperty("glide.servlet.uri");
// Return the URL for the dashboard page in the classic UI
return instanceURL + "now/nav/ui/classic/params/target/%24pa_dashboards_overview.do";
}
// If the user doesn't have the role, proceed with the default behavior
return gs.getProperty("glide.login.home"); // This will redirect to /now/sow/home by default
Thanks.