We have a number of web api services that currently use FluentValidation and SharpGrip.FluentValidation.AutoValidation for automatic asynchronous validation. It works really well.
At present the services are only used by one type of user but we're about to support users with different roles who, for some requests, will require different validation rules.
Having read the docs for FluentValidation, it seems that Rulesets would be an elegant solution to this problem. We could introduce a ruleset per role, and use the Default Ruleset for common rules. Then, we could evaluate the HttpContext.User to determine which roles/rulesets to use.
Has anyone used this approach before? How can we customize which rulesets are evaluated when using SharpGrip.FluentValidation.AutoValidation?
Thanks