Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Asp.net complex membership implementation

Posted on 2011-10-09
6
181 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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