Service portal widget login page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 03:48 AM - edited 10-26-2023 05:14 AM
Hi,
I need help in configuring and displaying hyperlinks in login page based on user roles.
Eg-in login page there is link to password reset that should be visible to internal users only. Can you guys give an idea to this requirment.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 03:55 AM
Hi @servicenow_devo ,
You can check in server script if the logged in user has the required role and set flag true and false according to that which can be used in hmtl using ng-if. Refer below sample code.
data.result = false;
if (gs.hasRole("internal user role")){
data.result= true;
}
<div ng-if=data.result>
Please check and Mark Helpful and Correct if it really helps you.
Regards,
Mayur Shardul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 05:00 AM - edited 10-26-2023 05:23 AM
Hi @Mayur2109
User has not logged in. This configuration needed to be set up in login page I have checked your code but it's not working and has role is something that works when user logins. And user matchs user table data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 04:01 AM
Hello,
How you will come to know user has roles when user is not logged in yet ? that's why it is not possible to hide this unless user logs in so follow how it works for Nowlearning/Community site etc.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 05:39 AM
Hello @servicenow_devo , this is impossible because we cannot validate roles for those not logged in yet.
However, you can configure password reset to be valid only for internal users
To do this, make these steps:
1- Search Password Reset > Default Self Service
2- Set the "apply to all users" to false
3- Create a Group Called Internal Users and add all internal users to this group
4- Add this group to the related list
Articles:
Reset a password or unlock a user account with service desk assistance (servicenow.com)
Configure your Password Reset process (servicenow.com)
This is an Out Of The Box functionality
If my answer helped you, please mark my answer as helpful.
Vanderlei Catione Junior | LinkedIn
Senior ServicePortal Developer / TechLead at The Cloud People