The syntax of:
[Authorize(Roles = "Admin,User")]
uses a named parameter. Which is actually a property in the class of the attribute. Since your class derives from AuthorizeAttribute
, which contains this property:
public string Roles { get; set; }
You should be able to use it as an argument in the constructor of AuthorizeCustom
.