[Authorize(Role=Role.Admin, Role.Client)]
does not work yet, [Authorize(Role="Admin,Client")]
works, I want to pass in strongly typed objects as I have them defined, does anyone know how?
I dont want to be hitting the database multiple times so something like:
[Authorize(Role=Role.Admin)]
[Authorize(Role= Role.Client)]
public ActionResult Something()
{
}
Is not ok for me...
EDIT:
Ok... so the previous question has been asked before, but I have amended, How do I create this as a delegate or function? I want to select one or more roles? Is this possible?
I could do:
[Authorize(x=> x.Role == Role.Admin && x.Role == Role.Client)]