
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 01:41 AM
Hi All,
Under the Toyo version, we noticed that the KPIs tab under the workspace "Platform Analytics Workspace" can also be called up by end users.
I would like to have assigned a role (pa_viewer) to this so that not everyone gets to see these figures. So it is not the intention to deactivate this function. However, I can't immediately find how to add this role. Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 04:49 AM
Yes, below is how you can do it.
1. Open UI Builder and open the workspace.
2. Go to "Analytics Center"page.
3. You'd notice that the page is read only so you have to duplicate the variant. Do it in the same scope as of original page and the new variant would be editable.
4. Now, you must add the hide condition on your tab. To do this click on "Tab set 1" component > Click on the configuration icon on KPIs tab(You'll find this in the configuration panel on right hand side).
5. Add the condition to hide the tab. Hover on it and click the script icon. Use below script to validate role.
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
let userRoles= api.context.session.user.roles;
return !userRoles.includes("pa_viewer");
}
6. Mark the OOTB variant inactive and that's it.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 04:49 AM
Yes, below is how you can do it.
1. Open UI Builder and open the workspace.
2. Go to "Analytics Center"page.
3. You'd notice that the page is read only so you have to duplicate the variant. Do it in the same scope as of original page and the new variant would be editable.
4. Now, you must add the hide condition on your tab. To do this click on "Tab set 1" component > Click on the configuration icon on KPIs tab(You'll find this in the configuration panel on right hand side).
5. Add the condition to hide the tab. Hover on it and click the script icon. Use below script to validate role.
/**
* @Param {params} params
* @Param {api} params.api
* @Param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
let userRoles= api.context.session.user.roles;
return !userRoles.includes("pa_viewer");
}
6. Mark the OOTB variant inactive and that's it.
ServiceNow Community Rising Star 2022/2023