MvcSiteMapProvider2 - AuthorizeAttributeAclModule.cs error

Jun 22, 2010 at 8:59 PM
Edited Jul 8, 2010 at 11:42 PM

old...

Jun 22, 2010 at 11:30 PM

since a lot of people inherit from AuthorizeAttribute I would suggest possibly changing the check from typeof to is

var currentAuthorizationAttributeType = authorizeAttribute.GetType();

var builder = new AuthorizeAttributeBuilder();
var subclassedAttribute = (authorizeAttribute is AuthorizeAttribute) ?
                          new InternalAuthorize(authorizeAttribute) : // No need to use Reflection.Emit when ASP.NET MVC built-in attribute is used
                          (IAuthorizeAttribute)builder.Build(currentAuthorizationAttributeType).Invoke(null);

Coordinator
Jun 23, 2010 at 1:59 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Jul 8, 2010 at 11:41 PM
Edited Jul 8, 2010 at 11:45 PM

oops.