ForActionsMatching an area and controller name?

121 Views Asked by At

Is there a way to build a predicate down to a list of actions with a specific name, in a specific controller, in a specific area?

1

There are 1 best solutions below

1
Kristoffer Ahl On BEST ANSWER

If you're area controllers are in a namespace specific to that area, you should be able to use the following:

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

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

If you're areas are in an assembly not reference by the application running FluentSecurity, you should have a look at Profiles in FluentSecurity 2.0.

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