ForActions匹配区域和控制器名称?

时间:2013-11-05 19:32:37

标签: fluent-security

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

1 个答案:

答案 0 :(得分: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