Asp.net mvc user management -
in asp.net mvc default application account controller enable user registration, log in, log out , changing password.
i wondering possible implement litle more enabling administrator delete user or give user different roles in asp.net configuration create user, roles , asign roles users?
i figured out , extend profile users, have more infos , profile picture.
if have experience or examples of user management in asp.net mvc.
although bit outdated, project maybe can give few hints on how implement membership administration in asp.net mvc:
asp.net mvc membership starter kit
quote
what asp.net mvc membership starter kit?
the starter kit consists of 2 things:
- a sample website containing controllers, models, , views needed administer users & roles.
- a library provides testable interfaces administering users & roles , concrete implementations of interfaces wrap built-in asp.net membership & roles providers.
out of box, starter kit gives following features:
- list of users
- list of roles
- user account info
- change email address
- change user's roles
update
for restricting operations specific user roles, can create these roles using project mentioned earlier, , decorate own application's controllers and/or actions authorize attribute, referencing desired roles:
[authorize(roles = "administrator, hr")] public actionresult deleteuser(int userid) { // }
this prevent users not administrator or hr delete users.
Comments
Post a Comment