Restrict visibility announcement on portal to specific groups.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I have a requirement to restrict the visibility of an announcement tile on the portal so that only members of specific groups can see it.
What I have done so far:
- Unchecked the Public option on the announcement
- Added User Criteria under Can View
- In the User Criteria, I specified the required groups and saved it
Issue:
Even though I am not a member of those groups, I am still able to see the announcement tile on the portal.
Additional details:
- The announcement is being fetched and displayed using a custom widget
- I suspect the User Criteria may not be getting evaluated properly at the widget level
Questions:
Why am I still able to see the announcement even though I don’t meet the User Criteria?
Does User Criteria automatically get enforced when announcements are fetched via a custom widget?
Do we need to explicitly evaluate User Criteria in the widget server script to restrict visibility?
If yes, what is the recommended way to evaluate User Criteria or group membership in the widget?
I am sharing the widget code below for reference.
Any guidance or best practices on implementing this requirement would be really helpful.
Thank you!
CODE:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
share how are you adding user criteria for announcement? share screenshots
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
surprisingly I couldn't see both the related list on form even after adding that system property
share screenshot of that user criteria where you applied that script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
we are using custom widget to get the announcements to display on the portal.
server script of the widget:
CODE:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
why widget script is written for handling announcement?
you already have user criteria to show/hide
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
