简体   繁体   中英

ASP.NET custom role management

There is Role Management feature in ASP.NET It works on local development machine.

For our project we need customers admin to be able to create new users and manage their roles. So, basically same what aspnet_regsql.exe does.

Question is Should we develop our own pages and forms or use some ready made tool?

Thanks!

I faced the same problem and solved it by integrating the SecurityGuard NuGet package. It has pretty nice user interface and allows you to manage users as well as roles.

Just following the guide at the following link: http://www.mvccentral.net/Story/Details/tools/kahanu/securityguard-nuget-package-for-asp-net-membership

Here is a guide with code to doing the role manager UI: MSDN article .

Have you seen this Web Admin tool?

It looks like this: 替代文字

Sounds like you need the SqlRoleProvider .

You can also plug in your own custom Role Provider (and Membership Provider). See How to: Sample Role-Provider Implementation

So that client can add users / manage roles after development is over.

Alex, I had exactly this problem on an application a couple of years ago and I found and adapted this sample:

Microsoft ASP.NET 2.0 Member/Role Management with IIS, Part 2: Implementation

There was a slight bug in the ToggleInRole_Click method that I had to tweak (I can give you my fix if you want) but apart from that it worked well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM