Where is the Current User's Role stored

Topics: CAB & Smart Client Software Factory
Oct 18, 2007 at 8:52 AM

I am a newbie to SCSF. I found the BankBranchWorkbench has two implementation of roles
one is from UserSelectorService, which is then used to initialize the GenericPrincipal.
The other is from SimpleRoleService, which is then used in WebServiceCatalogModuleInfoStore.

But it seems the former one in Thread.CurrentPrincipal is no use at all.

The current user's roles is actually decided in the roleService.GetRolesForUser, and which module will be loaded is charged by this role information.

Am I right?
Oct 18, 2007 at 10:30 PM

Yes, you’re right:
  • SimpleWinFormAuthenticationService uses the UserSelectorService to set the Thread.CurrentPrincipal identity.
  • Roles are retrieved using the SimpleRoleService.GetRolesForUser(string userName) method sending the Thread.CurrentPrincipal.Identity.Name (not its roles) as the parameter and then stored in a WebServiceCatalogModuleInfoStore.
  • It seems that the roles stored in the Thread.CurrentPrincipal (set by UserSelectorService) are never used.

Please let me know if this helps.

Ignacio Baumann Fonay