Below sample code is working in persistent login mobile template on my android mobile(mobile app/not a web app) which is great! but I need additional condition to get current user security group on client side and then activate panel based on a group. How do I get current user group in javascript client side in persistent login template?(not server side)
if(token != '' ) {
//token is present and not blank
//(we don't know if the token is valid or has not expired as the token cannot be decoded on the client-side)
//(we will only find out if the token is valid when an ajax callback is made to the server)
//since token was present you can take the user directly to the application panel [PANEL_APPLICATION].
//must also add the token to the UX state object so that it gets sent back on all Ajax callbacks
{dialog.object}.stateInfo['token'] = token;
//alert(Context.Security.GetRoles()); here I want to get user group(player or coach) and then based on this I will activate panel(player embedded ux panel or coach embedded ux panel)
{dialog.object}.panelSetActive('PANEL_APPLICATION',false);
//TIP: If you want to implement a client-side login, you could take the user to the client-side login panel
//rather than to the [PANEL_APPLICATION] panel. If the user then successfully authenticates at the client-side login panel
//you would then set focus to the [PANEL_APPLICATION] Panel.
} else {
//token not found or is blank - user must log in
{dialog.object}.panelSetActive('PANEL_LOGIN');
}
if(token != '' ) {
//token is present and not blank
//(we don't know if the token is valid or has not expired as the token cannot be decoded on the client-side)
//(we will only find out if the token is valid when an ajax callback is made to the server)
//since token was present you can take the user directly to the application panel [PANEL_APPLICATION].
//must also add the token to the UX state object so that it gets sent back on all Ajax callbacks
{dialog.object}.stateInfo['token'] = token;
//alert(Context.Security.GetRoles()); here I want to get user group(player or coach) and then based on this I will activate panel(player embedded ux panel or coach embedded ux panel)
{dialog.object}.panelSetActive('PANEL_APPLICATION',false);
//TIP: If you want to implement a client-side login, you could take the user to the client-side login panel
//rather than to the [PANEL_APPLICATION] panel. If the user then successfully authenticates at the client-side login panel
//you would then set focus to the [PANEL_APPLICATION] Panel.
} else {
//token not found or is blank - user must log in
{dialog.object}.panelSetActive('PANEL_LOGIN');
}
Comment