【问题标题】:Authorize all controllers in a given namespace?授权给定命名空间中的所有控制器?
【发布时间】:2013-05-01 16:01:14
【问题描述】:

是否可以使用 FluentSecurity 将 AuthorizeAttribute 应用于给定命名空间内的所有控制器?

【问题讨论】:

    标签: fluent-security


    【解决方案1】:

    是的,您可以在 FluentSecurity 2.0(目前处于测试阶段)中使用 ForAllControllersInNamespaceContainingType<TType>()ForActionsMatching(info => *predicate*) 来做到这一点。

    您可以在此处的文档中阅读有关它的更多信息:https://github.com/kristofferahl/FluentSecurity/wiki/Securing-controllers

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-26
      • 1970-01-01
      • 2014-05-19
      相关资源
      最近更新 更多