ASP.NET MVC: Can I say [Authorize Roles=“Administrators”] on the Controller class, but have one public action?
I started off using the default project's AccountController , but I've extended/changed it beyond recognition. However, in common with the original I have a LogOn and LogOff action. Clearly, the LogOn action must be accessible to everyone. However, since I've added lots of other actions to this controller (to create & edit users), I want 99% of the actions to require administrator role membership. I could decorate all my actions with [Authorize Roles="Administrators"] but there's a risk I'll forget one. I'd rather make it secure by default, by decorating the controller class itself with that