Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Asp.net complex membership implementation

Posted on 2011-10-09
6
Medium Priority
?
187 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

926 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