In WebApi, how & where would I plug in my authorization rules that are based on the resource metadata & audit information.
Here are all the interceptors that I am currently using in my request pipeline
- IHttpModule
- Delegating Handlers
- Authorization Filter
- ActionFilters
Background - My authorization rules around a DELETE request is based on the Audit information around the existing resource. For example, a user can only delete the resources that was created by him. So if a request to delete a resource comes from a user (with delete privileges) who has not created it, I should return a 403 error.
I am not aware of a way to access the Model & Repository from any of the 4 handlers that I am already using. Wondering what would be the right way to do it.