Marius Vasile

Marius Vasile

  • 590
  • 1.9k
  • 145.7k

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)