
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2019 02:01 PM
Hi,
Why gliderecord query does not return results while using in client scripts for non-admin users?
e.g.
var group = g_form.getValue('assignment_group');
var user = g_user.userID;
var ir = new GlideRecord('sys_user_grmember');
ir.addQuery('group', group);
ir.addQuery('user', user);
ir.query();
if(ir.next()){
g_form.setValue('assigned_to', user);
alert(ir.sys_id+'if');
}else{
alert(ir.sys_id+'else');
}
- If code runs with admin user logged/ impersonated, it alerts sys_id with 'if' string.
- If code runs with a non admin user logged/ impersonated, it alerts 'undefined' with 'else' string.
PS: I know, we should not use do sync calls to server from client unless required, and also gliderecord should not be used in a client script/ or client side scripts. But I am curious to know the reason, that script behaves differently for admins and non-admins.
Regards,
Anirban
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2019 09:22 AM
The table glided is on 'sys_user_grmember', however I still tried to test by deactivating the before query BR you mentioned. Did not return result either with non-admin.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2019 02:40 PM
This will be due to read ACL on sys_user_grmember table on your instance.
IT seems that only admin can read records from sys_user_grmember table on your instance.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 04:29 AM
But gliderecord script does not check acls, right?
The gliderecord stops working/ or does not return result set when called directly from client side in a session where the user does not have sufficient privilege on the queried table.
I am seeking some documentation/ actual reasoning on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 04:37 AM
I agree to this...
It has to be an ALC issue...
Cant verify this now but that's what comes closes to hand.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2019 02:49 PM
The Non admin user might not be a member of assignment group