c# - Why IPrincipal.IsInRole parameter is a String? -


i´m implementing iprincipal interface , fact role parameter string sounds strange me. guess there reasons that, want know why.

this because roleprovider pluggable section of authentication, can roll own (pun intended) , provide results user's role membership.

if imagine role based authentication mechanism needs have number of named roles not easy if based on typed or hard coded system. using string match against roles stored in way works out ok.

p.s. asp.net membership , authentication system mess overall , major upgrade in upcoming mvc5 , asp.net update using owin pattern.


Comments