title: Custom AuthorizeAttributte with Enum Roles params getting null Values in ajax call
body: <p>I'm having some problem with my custom AuthorizeAttribute</p>
  
  <pre><code>public class ExplicitAuthorizeAttribute : AuthorizeAttribute
  {
      private readonly MembershipUserRole[] _acceptedRoles;
  
      public ExplicitAuthorizeAttribute()
      {
  
      }
  
      public ExplicitAuthorizeAttribute(params MembershipUserRole[] acceptedRoles)
      {
          _acceptedRoles = acceptedRoles;
      }
  
      protected override bool AuthorizeCore(HttpContextBase httpContext)
      {  
         //Validation ...          
      }
  }
  </code></pre>
  
  <p>I use it like this:</p>
  
  <pre><code>[ExplicitAuthorize[(MembershipUserRole.Admin, MembershipUserRole.SuperAdmin)]
  </code></pre>
  
  <p>It works perfectly for HttpGet and HttpPost to validate my controllers and methods.</p>
  
  <p>But when I use it in a ApiController and make ajax calls, AuthorizeCore isn't running and I got a security breach. :/</p>
  
  <p>My enum looks like this</p>
  
  <pre><code>[Flags]
  public enum MembershipUserRole
  {
      Admin= 1,
      SuperAdmin = 2
  }
  </code></pre>
  
  <p><strong>Does anyone know why my AuthorizeCore isn't validating in this context?</strong></p>
  
  <p>By the way If I use</p>
  
  <pre><code>[Authorized(Roles ="Admin, SuperAdmin")]
  </code></pre>
  
  <p>It's validates perfectly, but I'd like to have Stronly Typed Roles,that's why I'm using enums.</p>