views:

42

answers:

2

I have a set of actions in a database, such as Add User, Edit User, Import Users, Send Invitation, etc. I have attached these permissions to roles. Then I attached these roles to users.

Is there a good pattern or API I can create for using this? I do not want to put a bunch of if/else statements in the code to check for permissions. So maybe interfaces would be good? Sorry for being so vague, I just do not know where to start and looking for advise on how to start this (perhaps an authorization rule provider?). Thanks in advance for any help.

A: 

Roles and membership might be worth looking at - http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx

It might be overkill for your site, but it is easy to use and implement.

adrianos
+1  A: 

Microsoft's Roles and membership is too basic and felt like it only deals with authentication but no authorization.

BUT I found exactly what I was looking for... Rhino Security!

http://www.ryantomlinson.com/post/An-Enterprise-Authorization-Framework-Part-1-Introduction.aspx

TruMan1
Interesting stuff.
Greg