Yes, those additionnal methods are mainly for management purpose, but then, you usually do want to manage them, except if you use some third-party programs. Honestly, the way it is done is ok, just bit strange. I much prefer the provider model, which you can configure and extend more easily, with no hard dependency. The IPrincipal is just like a role membership cache for one identity, which is kind of pointless when you are using a provider already. With GetAllRoles(), I was actually meaning that it returns all roles for the application and GetRoles(IIdentity) returns all roles for that one identity.
Sébastien On 12/18/07, Mark Brackett <[EMAIL PROTECTED]> wrote: > > I think the whole provider thing is an ASP.NET team initiative, not really > a BCL thing. Though I have heard requests that they extend (or publish > guidance) the ASP.NET membership providers to WinForms and the like. > > There's really no reason your own IPrincipal couldn't expose GetAllRoles() > (since IPrincipal wraps an IIdentity, it'd obviate the GetRoles(IIdentity) > method) if that's useful for you. I can't see it being much use in an > authorization scheme though...either you have the role you need to do > operation X or you don't. The ASP.NET MembershipProviders expose a > GetRoles(string username) method I think, but it's more for management than > runtime authorization checks. > > --MB =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com