FluentSecurity: How to assign multiple roles

481 Views Asked by At

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?

1

There are 1 best solutions below

0
Jen On BEST ANSWER

Ok I got it now.

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