I want to apply ASP.Net membership on areas in MVC3.0 project, but I dont want to put [Authorize] in controller. Is this possible if so then how can I achieve this.
Asked
Active
Viewed 86 times
2 Answers
0
You can implement the security checks yourself on the call to each method by overriding OnActionExecuting in a base controller (or each one if you don't want to implement a base controller) and decide whether to allow the call or not. Just out of curiosity why not use [Authorize]?

JTMon
- 3,189
- 22
- 24
-
I am just trying to prove that is there a way without using [Authorize] in controler – Basharat Masood Sep 06 '12 at 13:53
0
Yes you can implement global authorization in mvc3. You do this by first writing a global filter that overrides the default AuthorizeAttribute, then registering your custom filter in global.asax

Forty-Two
- 7,535
- 2
- 37
- 54