Search code examples
c#.netasp.netasp.net-membershipmembership

ASP.NET 'Guest' Membership


Is it possible to specify what is returned by RoleProvider.GetRoles() if a user is not logged in? I was thinking in case of a 'Guest' user account.


Solution

  • You could implement a custom role provider and override the GetRolesForUser method to return a guest role if no username is passed.