Link to home
Start Free TrialLog in
Avatar of karlomedallo23
karlomedallo23Flag for Australia

asked on

Asp.net complex membership implementation

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?
Avatar of brutaldev
brutaldev
Flag of South Africa image

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.
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.
Avatar of karlomedallo23

ASKER

@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?
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
@dale_burrell: if I implement one, is it possible to have 2 role providers active in one application?
ASKER CERTIFIED SOLUTION
Avatar of Dale Burrell
Dale Burrell
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial