Is it possible to specify multiple Policy's as a comma separated list similar to Roles?
Hi,
I was wondering if we have a way to specify multiple Policy's as a comma separated list similar to Roles?
Ex: I have 2 policies (Admin and Viewer). Controller would be only accessible by Admin Policy or Viewer policy
Not really, you probably have to write a new policy/handler that is the equivalent of either other policy.
That said if this was claim based, you could just have a single policy still, but a requirement that looked for either a "Admin" or "Viewer" claim, the built in ClaimRequirement allow specifying multiple allowed values
No plans to do this.
To learn more about how this stuff works, check out @blowdart 's super awesome incredible workshop tutorials. Step 6 goes into more details: https://github.com/blowdart/AspNetAuthorizationWorkshop#step-6-multiple-handlers-for-a-requirement