Feature/Auth: last one was authentication, this one is authorization #4

Merged
homeburger merged 33 commits from feature/auth into main 2026-04-23 00:18:39 -05:00
Showing only changes of commit 214f1601b5 - Show all commits

View File

@@ -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");