Marius Vasile

Marius Vasile

  • 1.1k
  • 1.1k
  • 34.9k

Authorize roles

Aug 24 2021 9:51 AM

I just want to know if I have in startup

 

options.AddPolicy("PTW", policy => policy.RequireRole("Management", "Safety", "PTWIssuer", "PTWReceiver", "PTWIsoCert"));

is similar with having in View

[Authorize(Policy = "PTW")]
[Authorize(Roles = "Management,Safety,PTWIssuer,PTWReceiver,PTWIsoCert")]

so it's enough only in startup and in view to keep only first line?


Answers (4)