2

In ASP.NET MVC, we can assign multiple roles in AuthorizeAttribute. I'm currently using Fluent Security. The documentation says RequireRolePolicy can support one or more roles.

I want to do the code below:

 configuration.For<MyController>(x => x.Index()).RequireRole("Administrator, Editor");

but it seems that it only checks one role. How to assign multiple roles to it?

Jen
  • 153
  • 2
  • 13

1 Answers1

3

Ok I got it now.

 configuration.For<MyController>(x => x.Index()).RequireAllRolesPolicy("Administrator", "Editor");
Kristoffer Ahl
  • 1,661
  • 2
  • 18
  • 36
Jen
  • 153
  • 2
  • 13