You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I apply Or condition between Policy and Roles in the AuthorizeAttribute? I need to expose an Action to the users which either belong to some roles or satisfying a particular AuthorizationPolicy. I was trying to achieving this like [Authorize(Policy = AuthorPolicyRequirementHandler.FooPolicy,Roles = RoleName.FooRoles)] [HttpGet] public IActionResult FOO(long id) { return Ok(); }
But this is applying the And condition. Is there any way to apply Or condition?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How can I apply Or condition between Policy and Roles in the AuthorizeAttribute? I need to expose an Action to the users which either belong to some roles or satisfying a particular AuthorizationPolicy. I was trying to achieving this like
[Authorize(Policy = AuthorPolicyRequirementHandler.FooPolicy,Roles = RoleName.FooRoles)] [HttpGet] public IActionResult FOO(long id) { return Ok(); }
But this is applying the And condition. Is there any way to apply Or condition?
Beta Was this translation helpful? Give feedback.
All reactions