- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 10:16 PM
Hey everyone, we have standard change template , where we have restricted access based on available for and non-qualified users are not able to access the template on portal but on Native UI still ITIL users able to access this template and created change request from Native UI. Why user criteria not working on native UI.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 11:34 PM
Hi @sunil maddheshi ,
I see the issue
var checkAgainstUC = Class.create();
checkAgainstUC.prototype = {
initialize: function() {},
checkForCatalogItem: function(catalogID) {
var userCriteria = [];
var catm2mgr = new GlideRecord('sc_cat_item_user_criteria_mtom');
catm2mgr.addEncodedQuery('sc_cat_item=' + catalogID);
catm2mgr.query();
while (catm2mgr.next()) {
userCriteria.push(catm2mgr.getValue('user_criteria'));
}
return sn_uc.UserCriteriaLoader.userMatches(gs.getUserID(), userCriteria)
},
type: 'checkAgainstUC'
};
since users are opening std_change_record_producer record directly in table they are able to access it
but the user criteria only evaluates in the catalog view
I would say hide create standard change ui action from the related link by creating above script include
and append the condition condition new checkAgainstUC().checkForCatalogItem(current.sys_id)
This will make sure the button is hidden from the end users
2. you can create a deny unless ACL(I won't recommend this since system has to evaluate every record against the user criteria as the no of records in the table increases you may see performance impact)
create the same script include that I have shared
and create a Deny unless ACL
Better go with the first approach of hiding the UI action
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 10:37 PM
so user criteria is working fine in portal but not for native?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 10:46 PM - edited ‎05-12-2025 10:56 PM
@Ankur Bawiskar Yes user don't have access for the template on portal but he can see the template on native UI and using the buttons in related links he is creating the change requests.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 10:56 PM
try adding some advanced script in user criteria and see if that log comes from native
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 11:16 PM
Hi Ankur, It is strange, For debugging I added that user in not available in template still he is able to access the std change template on native UI, I checked user role as well, he is ITIL user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 11:19 PM
it means User Criteria is not getting evaluate in native.
Please raise a case with ServiceNow
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader