---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideUser (Next Experience) - Client

# GlideUser (Next Experience) - Client {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
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.

## GlideUser (Next Experience) - getRoles() {#ariaid-title2}

Returns all roles assigned to the current user.
{#GlideUserNX-getRoles__table_aks_5rj_vfc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#GlideUserNX-getRoles__table_aks_5rj_vfc} {#GlideUserNX-getRoles__table_bks_5rj_vfc__entry__2}

| Type | Description |
|-|-|
| Array | Array of roles assigned to the current user. Includes explicitly granted roles, inherited roles, and roles acquired by group membership. |
[Table 2. Returns]

{#GlideUserNX-getRoles__table_bks_5rj_vfc}  
This example checks if the current user has the admin role.

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

Output:

    User is admin

This example logs all roles assigned to the current user.

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

Output:

    ['actsub_user', 'sn_publications_recipients_list_user', 'sn_publications.author', 'interaction_agent', 'interaction_admin', 'image_admin', 'sn_publications_recipients_user', 'workflow_publisher', 'knowledge']


