-4

I need to create some roles to assign to users in my experiment asp.net mvc page. The roles would be static and pretty basic such as "canViewPageA" or "canCreateNews" and would be used by the view files and the layout to either display or not display some of the page.

What I'm confused over is how the thing works, is the ApplicationRoleManager a static class? or do I need to create an instance of it? Also, I'm staring at IdentityConfig.cs and the constructor for ApplicationRoleManager, is this the right place to create the roles?

Claies
  • 22,124
  • 4
  • 53
  • 77
Jake Freelander
  • 1,471
  • 1
  • 19
  • 26
  • take a look at http://typecastexception.com/post/2013/11/11/Extending-Identity-Accounts-and-Implementing-Role-Based-Authentication-in-ASPNET-MVC-5.aspx-in-ASPNET-MVC-5.aspx for a comprehensive example of how to make use of identity users and identity roles. – Claies Sep 14 '14 at 18:41

1 Answers1

0

There is a nice collection of complete samples provided for asp.net identity.

http://www.asp.net/aspnet/samples/aspnet-identity

Use first link "ASP.NET Identity NuGet Samples" and install sample from NuGet into empty web application and try to understand how it works in real working application.

Hope this helps.

DSR
  • 4,588
  • 29
  • 28