Initial commit - ECommerce project

This commit is contained in:
2026-08-05 23:58:33 +03:00
commit bcebac18e7
63 changed files with 4543 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Commerce.Config;
public static class Authorization
{
public static IServiceCollection Authorize(this IServiceCollection services)
{
services.AddAuthorization(options =>
{
options.AddPolicy("Admin", policy => policy.RequireRole("ADMIN"));
options.AddPolicy("Moderator", policy => policy.RequireRole("Moderator"));
options.AddPolicy("Seller", policy => policy.RequireRole("Seller"));
});
return services;
}
}