【问题标题】:ForActionsMatching an area and controller name?ForActions 匹配一个区域和控制器名称?
【发布时间】:2013-11-05 19:32:36
【问题描述】:

有没有办法将谓词构建为具有特定名称、特定控制器、特定区域的操作列表?

【问题讨论】:

    标签: fluent-security


    【解决方案1】:

    如果您的区域控制器位于特定于该区域的命名空间中,您应该能够使用以下内容:

    configuration.ForActionsMatching(info =>
       info.ControllerType.Namespace.StartsWith("Some.Namespace")
    )
    

    https://github.com/kristofferahl/FluentSecurity/wiki/Securing-controllers

    如果您所在的区域在运行 FluentSecurity 的应用程序未引用的程序集中,您应该查看 FluentSecurity 2.0 中的配置文件。

    https://github.com/kristofferahl/FluentSecurity/wiki/Profiles

    【讨论】:

    • 啊,我没有考虑基于命名空间的查询。我想我可以做到这一点。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2011-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-21
    • 2020-02-13
    • 2021-02-16
    • 1970-01-01
    相关资源
    最近更新 更多