Hide Idea Score from Idea Portal for End Users

02Admin
Tera Contributor

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. 

3 REPLIES 3

SoureshD6782072
Kilo Expert

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.

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 : '-'"

Tanushree Maiti
Tera Patron

Hi @02Admin 

 

Refer:

https://www.servicenow.com/community/developer-forum/idea-portal-setup/m-p/1402162 

https://www.servicenow.com/community/spm-forum/can-you-limit-the-idea-portal-to-certain-user-groups/...

https://www.servicenow.com/community/spm-forum/can-you-limit-the-idea-portal-to-certain-user-groups/...

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti