Security trimming and custom AuthorizeAttribute

Sep 10, 2010 at 4:11 PM
Edited Sep 10, 2010 at 4:29 PM

Hello,

When I use MyAuthorizeAttribute to decorate MVC controller method, the security trimming doesn't work.

It seems that AuthorizeAttributeAclModule.cs look for type AuthorizeAttribute instead of classes implemented IAuthorizeAttribute.

Is it possible to change code to look for classes implemented IAuthorizeAttribute interface ?

Thanks.

<Yves/>

Sep 10, 2010 at 4:29 PM

Hi,

I understand why we have to create a subclass from AuthorizeAttribute...

because, subclassedAttribute call AuthorizeCore() and not OnAuthorization()

<Yves/>

Sep 21, 2010 at 3:16 PM

Also, make sure you have not sealed your custom attribute class.