Hide Idea Score from Idea Portal for End Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
I have an ask to restrict any user without admin or idea_admin role from seeing the idea score in the idea portal. The reason being not wanting end users to feel like they are voting or upvoting / downvoting based on the current number of each the idea has. I tried to accomplish this by adding a field ACL for the score field, but this did not work. I looked at the widget HTML and found where it is grabbing the idea details including the score, but I am unsure if I can limit it there or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Restrict the score in the server-side widget logic based on role:
Users with admin or idea_admin can see score.
All other users should not receive the score value at all.
Do not only hide it in HTML or CSS, because the value may still be visible in the browser payload / Angular model.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Thank you! This helped nudge me in the right direction.
I was able to get this working by adding the following line to the Server Script:
data.canSeeScore = gs.hasRole('admin') || gs.hasRole('idea_admin');
Then I edited the HTML to this:
score="data.canSeeScore ? idea.score : '-'"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi @02Admin
Refer:
https://www.servicenow.com/community/developer-forum/idea-portal-setup/m-p/1402162
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti