Simple MVC User Management is a user management solution to quickstart your ASP.NET MVC project.
Widgets for managing users and roles are generated by a static html/js/css helper. These widgets can be included in any existing administration page and there is no need to create additional views or areas. One controller is included which provides the membership and role information.
Please note that this solution is ajax only and all membership and role information is rendered on the client through javascript.
Latest Version: 0.1.1
##Features:
- Paged user list by using mottie's tablsorter fork and pager plugin (included in MyHtmlHelper)
- Create / delete user accounts
- Create / delete roles
- Manage roles for users
- Client-side success and error messages
- Custom user authorization possible
- Any membership or roleprovider can be used
##Dependencies
-
= jQuery 1.7
- ASP.NET MVC2 or 3
You can watch a demo of the latest development version at http://usermanagementdemo.apphb.com.
(The providers used for the demo are incomplete dummies, so you won't see the real membership provider behavior in all cases.
Add a reference to the SimpleMVCUserManagement.dll
Include routing and authorization code
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//register user management controller route
UserManagementController.RegisterMe();
// your routes
// ...
}
protected void Application_AuthenticateRequest()
{
// check if the user management controller is the target controller for this request
if (UserManagementController.IsTargeted())
{
// Do any custom authorization checks here (e.g. Roles.IsUserInRole("Admin"))
UserManagementController.IsRequestAuthorized = true;
}
}
Include in your web.config
<add namespace="SimpleMvcUserManagement"/>
Include in your administration view
@*html markup*@
@MyHtml.UserTableArea() // html code for the user table
@MyHtml.AddUserForm() // html code for creating a new user account
@MyHtml.ManageRolesForm() // html code for managing roles
@*css*@
@MyHtml.TableCss() @*optional - basic tablesorter css styles*@
@MyHtml.StyleCss() @*recommended - info message and some layout css styles*@
@*javascript*@
@MyHtml.UiJavascript() @*required - user interface javascript code including tablesorter, pager and user interface code*@
##Changes 0.1.1 Added css classes for the user table
Licence: Under MIT or GPL licenses, just pick one.