Reputation: 25
I understand I can use decorators and filters, but then wouldn't I have to specify at the top of every ActionResult? Need something of a blanket approach to the entire controller.
Upvotes: 0
Views: 62
Reputation: 57803
You can use the AuthorizeAttribute on the controller:
When you mark an action method with AuthorizeAttribute, access to that action method is restricted to users who are both authenticated and authorized. If you mark a controller with the attribute, all action methods in the controller are restricted.
Upvotes: 4