- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-12-2022 03:53 AM
Hi,
in a catalog item i have in not available for a user criteria
if( new uc().haveBtw() && new uc().havelaptop() )
answer = true;
else
answer = false;
in the script include i have
haveBtw: function() {
gr.addEncodedQuery("principal=yes^model_category=27fab026dba43200cd8d7b9dae961948^ORmodel_category=affab026dba43200cd8d7b9dae961947^tagSTARTSWITHBTW^assigned_to=" + session.getClientData('requestor'));
gr.query();
while (gr.next()) return true;
return false;
},
havelaptop: function() {
var portable = "affab026dba43200cd8d7b9dae961947";
var gr = new GlideRecord('hardware');
gr.addQuery('model_category', portable);
gr.addQuery('assigned_to', session.getClientData('requestor'));
gr.query();
while (gr.next()) return true;
return false;
},
when i check the hardware table user have all the condition true principal=yes , category = portable tagSTARTSWITHBTW , the user must not see the item because all the condition are true but i don't know wwhy yser cav view the item and even in user criteria diagnostic i get user can view the item
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-12-2022 05:17 AM
Please check user roles, user criteria always allow admin users to access records.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-12-2022 05:25 AM
when i check user role i found that he has the role admin and user admin , it is possible that is the reason why he can see the item even the condition of user criteria true

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-12-2022 05:32 AM
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-12-2022 05:38 AM
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-12-2022 05:17 AM
hi
i have this line in my scritp i just forget to copy the line