Check if SNC.UserCriteriaLoader.getAllUserCriteria() works in server widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 09:55 AM
Hi,
I need to check the next in all active kb categories:
1) Kb category has subcategories?
2) Kb category has kb articles related directly with this kb category?
3) User logged can view kb articles?
In point 3, I have this addQuery in kb_knowledge GlideRecord:
gr.addQuery('can_read_user_criteria', 'IN', SNC.UserCriteriaLoader.getAllUserCriteria()).addOrCondition('can_read_user_criteria', '');
With this add query can I check visibility of the user according to User Criteria the kb articles have?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 08:48 AM - edited 03-31-2025 09:17 AM
UserCriteriaLoader.getAllUserCriteria() method is a deprecated method and we advice using userMatches() instead.
☞ Please refer to this article below, which explains on this in detailed.
https://www.servicenow.com/community/now-platform-blog/a-deep-dive-to-user-criteria/ba-p/2281285
Below are additional Knowledge articles which discusses Semaphore Exhaustion caused by the getAllUserCriteria function being called in widgets:
Semaphore Exhaustion is caused due to the getAllUserCriteria function getting called in widgets
Semaphores keep getting stuck and cause slow performance due to UserCriteriaLoader.getAllUserCriteri...