diff --git a/api/Program.cs b/api/Program.cs index c74de6b..6e4f8b7 100644 --- a/api/Program.cs +++ b/api/Program.cs @@ -46,6 +46,9 @@ builder.Services.AddAuthentication(options => { }; }); +// TODO: adding roles doesnt work atm because roles need to be seeded in the database first +// maybe programamatically checking them at startup like if(roleManager_.FindAsync("Admin") == null { roleManager_.addAsync("Admin"); }) +// or something builder.Services.AddAuthorization(options => { options.AddPolicy("RequireAdmin", policy => { policy.RequireRole("Admin", "Superuser");