How to implement a role based user management system with ASP.NET MVC 4

混江龙づ霸主 提交于 2019-12-07 15:03:14

问题


Although I'm new to ASP.NET I have to implement a role based user management system for an ASP.NET MVC 4 application (Visual Studio 2010). Users have one or more of these roles: Admin, Manager, User. Based on the role users have access to different areas. There is a predefined table with users.

I know that ASP.NET provides something to implement this requirement but I am confused by the information I get. Even though there is a lot of information I can't find an adequate documentation or blog post. Everything starts and ends somewhere else. There seem to be many different but similar solutions.

Sorry for asking such a broad question but I have the impression that I am not the only one confused by this. A pointer to a good documentation or an example project would help me a lot.


回答1:


Take a look at this:

SimpleMembership, Membership Providers, Universal Providers and the new ASP.NET 4.5 Web Forms and ASP.NET MVC 4 templates

It a new feature that simplify all the membership/role management.




回答2:


Here is an article for ASP.NET MVC 3 (Razor) that covers membership and roles. I don't believe things changed greatly between MVC 3 and 4 with regard to the builit-in membership provider - http://www.c-sharpcorner.com/uploadfile/b19d5a/membership-and-authorization-in-Asp-Net-mvc-3-razor/

Additionally, here is the portion of Microsoft's Music Store tutorial that deals with membership - http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-7

Hope they help.




回答3:


You can consider to use a web application framework. See http://www.aspnetboilerplate.com/

Also, See http://www.aspnetzero.com/ it has ready user, role.. management pages and can be good start point for new applications.



来源:https://stackoverflow.com/questions/17971081/how-to-implement-a-role-based-user-management-system-with-asp-net-mvc-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!