Hi,
There are two things that you need to change...
a) Authentication Success is fired when you are just authenticated but your UserManager hasnot syncd yet. So, you need to either listen to creationComplete event in ConnectSessionContainer or Synchronization change event and there you need to call the role.
b) You get your role from UserManager, so you need to call cSession.userManager.myUserRole . Here is your modified code:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:rtc="AfcsNameSpace" creationComplete="showLogin()">
<rtc:ConnectSessionContainer id="cSession" autoLogin="false" width="100%" height="100%" roomURL="https://connectnow.acrobat.com/myAccount/myfirstroom" creationComplete="handleSuccess()">
<rtc:authenticator>
<rtc:AdobeHSAuthenticator id="auth" />
</rtc:authenticator>
</rtc:ConnectSessionContainer>
<mx:Script>
<![CDATA[
import com.adobe.rtc.sharedManagers.descriptors.UserDescriptor;
import mx.managers.PopUpManager;
protected function showLogin():void
{
var login:LoginDialog = new LoginDialog();
login.connectSession = cSession;
PopUpManager.addPopUp(login, this);
PopUpManager.centerPopUp(login);
}
private function handleSuccess():void{
trace("MY ROLE "+ cSession.userManager. myUserRole);
}
]]>
</mx:Script>
</mx:Application>
Hope this helps.
Thanks
Hironmay Basu