ui script

Rosy14
Tera Guru

how to get the roles of logged in user in ui script. tried g_user.hasRole . not working.

3 REPLIES 3

Sohail Khilji
Kilo Patron
Kilo Patron

Can you explain your requirement and purpose ....


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Rosy14
Tera Guru

i had added the ui script for redirecting in side ec_url_whitelist ui script of ESC portal. but this redirecting will happen only for certain role.

if (!g_user.hasRoleExactly('itil') && window.location.toString().indexOf(''XYZ'') > 0) {
    //     var url = window.location.href;
    //     url = url.replace('abc, 'pqr');
    //     window.location.assign(url);
    // }

Rosy14
Tera Guru

Rosy14_0-1707060453634.png

here in oob ui script they have used user. how it is configured?