- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
I have a button on a UI Builder page that I only want to show if the current user does not have any of the roles such as "sn_grc.business_user_lite" and "sn_risk.manager"
Can anyone explain how I could achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
@Biddaum ,
follow the same process mentioned above, just change the script
/**
* @param {params} params
* @param {api} params.api
* @param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({
api,
helpers
}) {
var currentUserRoles = api.context.session.user.roles;
if (currentUserRoles.includes('sn_grc.business_user_lite') ||
currentUserRoles.includes('sn_risk.manager')) {
return true;
}
return false;
}Now try out this script and check.Now the button is not visible if the user is having either any of the roles otherwise it will not visible.
If my response helped, mark it as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
how is that button created?
share some screenshots of the config etc
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
