CAD · Question #4
Which one of the following is true for GlideUser (g_user) methods?
The correct answer is C. Can be used in Client Scripts, UI Policies, and UI Actions. GlideUser (g_user) is a client-side JavaScript object that provides information about the currently logged-in user. Because it runs in the browser (client side), it is available in Client Scripts and UI Policies (both client-side). It is also available in UI Actions when they exe
Question
Which one of the following is true for GlideUser (g_user) methods?
Options
- ACan be used in Client Scripts and UI Policies only
- BCan be used in Business Rules only
- CCan be used in Client Scripts, UI Policies, and UI Actions
- DCan be used in Business Rules, and Scripts Includes
How the community answered
(43 responses)- A5% (2)
- C93% (40)
- D2% (1)
Explanation
GlideUser (g_user) is a client-side JavaScript object that provides information about the currently logged-in user. Because it runs in the browser (client side), it is available in Client Scripts and UI Policies (both client-side). It is also available in UI Actions when they execute client-side code. It is NOT available in server-side scripts such as Business Rules or Script Includes, which run on the server and instead use the GlideSession or GlideUser server-side APIs. Therefore, the correct scope is Client Scripts, UI Policies, and UI Actions.
Topics
Community Discussion
No community discussion yet for this question.