Security icon indicating copy to clipboard operation
Security copied to clipboard

Is it possible to specify multiple Policy's as a comma separated list similar to Roles?

Open valcs007 opened this issue 10 years ago • 3 comments

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

valcs007 avatar Jul 26 '16 18:07 valcs007

Not really, you probably have to write a new policy/handler that is the equivalent of either other policy.

HaoK avatar Jul 26 '16 21:07 HaoK

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

HaoK avatar Jul 26 '16 21:07 HaoK

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

Eilon avatar Jul 28 '16 23:07 Eilon