0

The project is C# asp.net 4.5 (not MVC).

When in my master page, or an aspx/ascx page, you can tell if a user is in a role:

<% if(Context.User.IsInRole("the role to check")) { blaw blaw } %>

Is there a similar way to check if a user has 'confirmed' their account? Something like

<% if(Context.User.IsConfirmed()) { blaw blaw } %>

Do I just need to derive my own IPrincipal based class?

Robert Achmann
  • 1,986
  • 3
  • 40
  • 66
  • Define "confirmed". You could make a role. – SLaks Feb 04 '18 at 18:23
  • Yes that is possible. You will need to [create a custom principal identity](https://learn.microsoft.com/en-us/dotnet/framework/wcf/extending/how-to-create-a-custom-principal-identity) and then add `IsConfirmed` method/property to it and provide the implementation for it. Then you can use it wherever you need to. – CodingYoshi Feb 04 '18 at 18:55

0 Answers0