This commit is contained in:
@@ -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 => {
|
builder.Services.AddAuthorization(options => {
|
||||||
options.AddPolicy("RequireAdmin", policy => {
|
options.AddPolicy("RequireAdmin", policy => {
|
||||||
policy.RequireRole("Admin", "Superuser");
|
policy.RequireRole("Admin", "Superuser");
|
||||||
|
|||||||
Reference in New Issue
Block a user