0

Is it possible to have an authorization that will be based on ROles or Users.

Sample:

[Authorize(Users = "XXX\\USER1")]
[Authorize(Roles = "ADMIN")]
public class AdminEntityController : Controller
{..code here...}

My goal is if the role is admin OR the user is XXX\USER1 I will allowed to request in the server. How can I do that?

Vic
  • 357
  • 1
  • 4
  • 18
  • These links might help you https://stackoverflow.com/questions/700166/allow-multiple-roles-to-access-controller-action & https://stackoverflow.com/questions/10754073/building-customauthorization-in-asp-net-mvc/10754108#10754108 – Arib Yousuf Mar 18 '21 at 13:36
  • You can use policy based authorization. For checking more than one authorization – Golda Apr 01 '21 at 06:57

0 Answers0