Is it possible to implement object-level security with a custom ActionFilterAttribute
?
I read Branislav Abadjimarinov's answer to Get permission from Authorize Attribute? and started thinking about making an AuthorizeAttribute
-like action filter for implementing object-level security.
Suppose I were to call it ObjectAuthorizeAttribute
with the intended usage:
[ObjectAuthorize]
public ActionResult Edit(int id)
{
//...
What would be the easiest way to access the ID value within OnActionExecuting
?
Is something like this already available?