GlideUser (g_user)
The GlideUser
class is available to client scripts as the g_user
object, which is initialized to the current user that's signed in.
The GlideUser
client-side API gives you easy access to determining certain details about the user, including the user's name, roles, sys_id, and a method for getting access to client data set via the putClientData()
API on the server.
The GlideUser
(g_user
) API is particularly useful because it eliminates the need to execute client-side GlideRecord
queries, which are costly in terms of performance or slow in terms of execution time.
Getting user details
A fair amount of the user's profile details can be gleaned from the GlideUser
(g_user
) API, as they are cached when the page is loaded.
There is a method to access the user's full name: getFullName()
. This method accepts no arguments, but returns a string containing the current user's full name.
The user's first and last name are available via properties. Properties can be access directly without...