GlideUser \(Next Experience\) - Client

concept australia Updated Sep 10, 2026 1 min read GlideUserAPINX.md
Raw file servicenow.com

The GlideUser API provides a method to access information about current user roles in the Next Experience UI Framework.

GlideUser methods are accessed through a global object (g_user) that is only available in client scripts.

Parent Topic:Client Next Experience API reference

GlideUser (Next Experience) - getRoles()

Returns all roles assigned to the current user.

Name Type Description
None
Type Description
Array Array of roles assigned to the current user. Includes explicitly granted roles, inherited roles, and roles acquired by group membership.

This example checks if the current user has the admin role.

JavaScript
if (g_user.getRoles().indexOf('admin') !== -1) {    console.log('User is admin');}

Output:

Text
User is admin

This example logs all roles assigned to the current user.

JavaScript
function onChange(control, oldValue, newValue, isLoading, isTemplate) {   if (isLoading || newValue === '') {      return;   }   console.log(g_user.getRoles());}

Output:

CSS
['actsub_user', 'sn_publications_recipients_list_user', 'sn_publications.author', 'interaction_agent', 'interaction_admin', 'image_admin', 'sn_publications_recipients_user', 'workflow_publisher', 'knowledge']
Search documentation
Search document titles and file paths on the australia branch