I'm trying to do something like this:
[CustomAuthorize(Permissions = new[] { /*These are Enums */Permissions.CanChangeProducts.ToString(), Permissions.CanChangeNames.ToString()})]
public ActionResult MyMethod()
{
return View();
}
It gives the error:
Error 5 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type [...]
I've managed to put Resource string into validationattibutes, but I could'n manage to put this enum (string) array into a authorize attribute... How can I do that? Any help would be appreciated!