Reputation: 160
In visual studio 2013, the newly create MVC 5 project with individual authentication includes the sample code to create user through OWIN, but there is no sample code to create role and assign role to user.
Anybody knows how to build UI, including models, views and controllers, to manage OWIN roles (AspNetRoles) and user roles(AspNetUserRoles) in MVC 5?
Upvotes: 1
Views: 2903
Reputation: 1011
If you want to manage the AspNetUsersRoles, you must make the following modification.
1. Remove the primary key, actually is conformed by UserId and RoleId
2. Add a new Id field in the table and check like primary key.
3. Update your model.
Now you can scaffolding this entities and create the controllers and the views.
Upvotes: 0
Reputation: 7435
A new OSS project was just released that is meant to help you with this:
http://brockallen.com/2014/04/09/introducing-thinktecture-identitymanager/
Upvotes: 1