- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 10:07 PM - edited 02-05-2024 10:10 PM
I am trying to use g_user.hasRole
but I got a ReferenceError: g_user is not defined.
so can't I use g_user in a client script of a widget?
In that case how do I got the Role of the current user role or some other user information.
I am new to this, can anyone help me.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 10:16 PM
Hi @jieLian123 you can do that in server side and call it to client controller
Server side Code:
data.checkRole = gs.hasRole('itil');
client side
if(c.data.checkRole){
//your logic
}
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 10:16 PM
Hi @jieLian123 you can do that in server side and call it to client controller
Server side Code:
data.checkRole = gs.hasRole('itil');
client side
if(c.data.checkRole){
//your logic
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 10:39 PM
thank you very much. it works.