开发者

Area-global filters in MVC 3

开发者 https://www.devze.com 2023-02-25 08:21 出处:网络
Since it doesn\'t appear to be support开发者_StackOverflow社区ed natively, what\'s the recommended way of implementing global filters on a per-area basis?The reason it\'s not supported natively is bec

Since it doesn't appear to be support开发者_StackOverflow社区ed natively, what's the recommended way of implementing global filters on a per-area basis?


The reason it's not supported natively is because we want to discourage developers from doing it. Areas are not associated with controllers; they're associated with routes. We wanted to discourage developers from trying to apply authorization or other security-sensitive filters to areas since they can be bypassed.

See How can we set authorization for a whole area in ASP.NET MVC? for more information.


You could use a custom IFilterProvider.

0

精彩评论

暂无评论...
验证码 换一张
取 消