0

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.

tereško
  • 58,060
  • 25
  • 98
  • 150

2 Answers2

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
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

Check out this blog post for more details

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