views:

69

answers:

2

What is the best way (for a .Net 4 project) to implement authorization in the business layer. Simply I want to check whether a certain identity can access a certain action/resource.

I've tried to look this up in Patterns & Practices, but haven't found anything useful yet.

And what about PrincipalPermission of ASP.Net 2.0? Is this still relevant? What about maintenance?

I want to use an elegant solution, preferably (re)using asp.net role management.

Thanks!

A: 

When you simply want to prevent any code from being called in the situation that the user (for whom the code is running) and throwing an exception is a fine resolution, in that scenario PrinicipalPermissionAttribute works great and is still relevant.

Steven
A: 

As far as I can see, if the application needs role based security at runtime the Attribute can only be used as a backstop in case of some coding error. CSLA.net has security in the business layer where you can have any number of custom rules so long as their implementation returns a boolean.

jradxl