I am using MVC3/4. But it is just a general question in authorization.
One of the role I have is named “Trip Leader” in the database, which contains a space.
I tried [Authorize(Roles="'Trip Leader', Administrator")] but it failed to work. Can anyone help?
Create your own attribute and derive from AuthorizeAttribute. Then override the AuthorizeCore method and implement your own logic with validation on a role that contains a space.
An example could be something like this:
Usage