Solved

Asp.net complex membership implementation

Posted on 2011-10-09
6
182 Views
Last Modified: 2012-05-12
Hi,
I need to implement a somehow complex membership and authorisation. The requirements include a the normal authentication... But each user can be a member of 1 or more group. And their role per group may differ. Eg. User1 can be a member of group A in which he is an administrator... And be a member of group B but with a role of jus a regular user.
Apart from that, each member may have different "permissions" that they can do something like the NT logins.
I have reasearched that I can probably use azman... Is azman good? Is there an alternative approach like a modified role provider? Is there such as group provider?
0
Comment
Question by:karlomedallo23
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:brutaldev
ID: 36939284
Why not use the built-in role membership provider that comes with ASP.NET? Once this is in place it's as easy as using HttpContext.Current.User.IsInRole("MyRole") to check for permission.
0
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 36939601
The built in membership provider doesn't allow for groups and roles within groups, but you could handle that yourself with a specified role naming convention e.g.

Group1-Member
Group1-Admin
Group2-Member
Group2-Admin

Then you can assign to users as you like, and implement the checks in the page as you like.
0
 
LVL 2

Author Comment

by:karlomedallo23
ID: 36975827
@brutaldev: roles provider is not enough for what's required. To be clear, I need, sort of, 4 providers... Membership, group, roles, and permissions...

@dale_burrel: I could have settled down with what you have suggested but thhe permissions are really getting on the way.. is ithere a way to implement a custom "provider" in which I would probably call permissions provider and will work together with the roles provider? Or maybe implement two instances of roles provider 1 for your group_role suggeztion Nd the other for permission?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:Dale Burrell
ID: 36976704
You can certainly implement custom providers... I've never done it so I can only offer the MS documentation e.g. http://msdn.microsoft.com/en-us/library/8fw7xh74.aspx
0
 
LVL 2

Author Comment

by:karlomedallo23
ID: 36977523
@dale_burrell: if I implement one, is it possible to have 2 role providers active in one application?
0
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 500 total points
ID: 36977550
You definitely can, i haven't had much experience with multiple providers, but I from what I have had you end up needing to do a bit more work, because the membership framework uses the initial providers you specify, but when you need more than one you actually have to explicitly tell it which provider you are using.

A quick google for "asp.net multiple role providers" gives plenty more information. I recon what you may want to do is create a single custom role provider which accesses its data from 2 separate sources depending on circumstances.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question