The following code extracts from the database the list of application-defined roles associated with the logged-on user strUserName. The list is stored in the string array strRoles:
strRoles = RoleBasedSecurity.LoadRoles(strUserName)
The next line of code shown assigns the Principal for strUserName—containing the user name and associated roles—to the current thread:
RoleBasedSecurity.SetPrincipalPolicy strUserName
3.145.75.93