gs.hasRoleExactly('itil') is returning undefined

Sachin G K1
Kilo Sage

Hi All,

gs.hasRoleExactly('itil'), is returning undefined. But gs.hasRole('itil') is returning true please help.

SachinGK1_0-1709621853034.png

SachinGK1_1-1709621888260.png

 

12 REPLIES 12

It won't work on Script include. 

 

Rather try : 

 

var roles = gs.getUser().getUserByID().getRoles()+ '').split(',');

for(var i=0; i<roles.length; i++){

if(roles[i] == role ) return true;

 

}

 

Hi @Sohail Khilji 

SachinGK1_0-1709640286875.png

I tried as you suggested, Line 7 is only returning "taxonomy_admin" and the in above script 'if' condition evaluated to 'false' else part executed.

Mark Manders
Tera Patron