forked from sanchezvem/pyrofetes-backend
Put roles into endpoints
This commit is contained in:
@@ -9,7 +9,7 @@ public class GetAllCustomersEndpoint(CustomersRepository customersRepository, Au
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/customers");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class CreateDelivererEndpoint(DeliverersRepository deliverersRepository)
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/deliverers");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateDelivererDto req, CancellationToken ct)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class DeleteDelivererEndpoint(DeliverersRepository deliverersRepository)
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/deliverers/{@Id}", x => new { x.DelivererId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteDelivererRequest req, CancellationToken ct)
|
||||
|
||||
@@ -9,7 +9,7 @@ public class GetAllDelivererEndpoint(DeliverersRepository deliverersRepository)
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/deliverers");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GetDelivererEndpoint(DeliverersRepository deliverersRepository, Aut
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/deliverers/{@Id}", x => new { x.DelivererId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetDelivererRequest req, CancellationToken ct)
|
||||
|
||||
@@ -12,7 +12,7 @@ public class UpdateDelivererEndpoint(DeliverersRepository deliverersRepository,
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/deliverers/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateDelivererDto req, CancellationToken ct)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CreateDeliveryNoteEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/deliveryNotes");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateDeliveryNoteDto req, CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DeleteDeliveryNoteEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/deliveryNotes/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteDeliveryNoteRequest req, CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetAllDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/deliveryNotes");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetAllDeliveryNotesNotArrivedEndpoint(DeliveryNotesRepository deliv
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/deliveryNotes/validation");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class GetDeliveryNoteEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/deliveryNotes/{@Id}", x => new { x.DeliveryNoteId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetDeliveryNoteRequest req, CancellationToken ct)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class GetDeliveryNotePdfEndpoint(DeliveryNotesRepository deliveryNotesRep
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/deliveryNotes/{@Id}/pdf", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
Description(b => b.Produces<byte[]>(200, MediaTypeNames.Application.Pdf));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class PatchRealDeliveryDateEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/deliveryNotes/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchDeliveryNoteRealDeliveryDateDto req, CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class UpdateDeliveryNoteEndpoint(DeliveryNotesRepository deliveryNotesRep
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/deliveryNotes/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateDeliveryNoteDto req, CancellationToken ct)
|
||||
|
||||
@@ -15,7 +15,8 @@ public class DeleteProductEndpoint(ProductsRepository productsRepository) : Endp
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/products/{@Id}", x => new { x.ProductId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteProductsRequest req, CancellationToken ct)
|
||||
|
||||
@@ -9,7 +9,7 @@ public class GetAllProductsEndpoint(ProductsRepository productsRepository) : End
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/products");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetAllProductsUnderLimitEndpoint(ProductsRepository productsReposit
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/products/underLimit");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -18,7 +18,8 @@ public class GetProductEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/products/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetProductRequest req, CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PatchProductMinimalStockEndpoint(ProductsRepository productsReposit
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/products/{@Id}/MinimalStock", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchProductMinimalStockDto req, CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class UpdateProductEndpoint(ProductsRepository productsRepository, AutoMa
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/products/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateProductDto req, CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class AddProductFromPurchaseOrderEndpoint(PurchaseProductsRepository purc
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/purchaseOrders/{@PurchaseOrderId}/{@ProductId}", x => new { x.PurchaseOrderId, x.ProductId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreatePurchaseProductDto req, CancellationToken ct)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CreatePurchaseOrder(
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/purchaseOrders");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreatePurchaseOrderDto req, CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DeleteProductFromPurchaseOrderEndpoint(PurchaseProductsRepository p
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/purchaseOrders/{@ProductId}/{@PurchaseOrderId}", x => new { x.ProductId, x.PurchaseOrderId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeletePurchaseProductRequest req, CancellationToken ct)
|
||||
|
||||
@@ -15,7 +15,8 @@ public class DeletePurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrders
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/purchaseOrders/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeletePurchaseOrderRequest req, CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetAllPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrders
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/purchaseOrders");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GetPurchaseOrderEndpoint(PurchaseOrdersRepository purchaseOrdersRep
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/purchaseOrders/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetPurchaseOrderRequest req, CancellationToken ct)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class GetPurchaseOrderPdfEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/purchaseOrders/{@Id}/pdf", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
Description(b => b.Produces<byte[]>(200, MediaTypeNames.Application.Pdf));
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class PatchPurchaseOrderPurchaseConditionsEndpoint(PurchaseOrdersReposito
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/purchaseOrders/{@Id}/PurchaseConditions", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchPurchaseOrderPurchaseConditionsDto req, CancellationToken ct)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class PatchPurchaseProductQuantityEndpoint(PurchaseProductsRepository pur
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/purchaseOrders/{@ProductId}/{@PurchaseOrderId}/Quantity", x => new { x.ProductId, x.PurchaseOrderId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchPurchaseProductQuantityDto req, CancellationToken ct)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class AddProductoToQuotationEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/quotations/{@Id}/products", x => new { x.ProductId, x.QuotationId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(AddQuotationProductDto req, CancellationToken ct)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CreateQuotationEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/quotations");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DeleteProductFromQuotationEndpoint(QuotationProductsRepository quot
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/quotations/{@ProductId}/{@QuotationId}", x => new { x.ProductId, x.QuotationId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteQuotationProductRequest req, CancellationToken ct)
|
||||
|
||||
@@ -15,7 +15,8 @@ public class DeleteQuotationEndpoint(QuotationsRepository quotationsRepository)
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/quotations/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteQuotationRequest req, CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetAllQuotationEndpoint(QuotationsRepository quotationsRepository)
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/quotations");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class GetQuotationEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/quotations/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetQuotationRequest req, CancellationToken ct)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class GetQuotationPdfEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/quotations/{@Id}/pdf", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
Description(b => b.Produces<byte[]>(200, MediaTypeNames.Application.Pdf));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class PatchQuotationConditionsSaleEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/quotations/{@Id}/saleConditions", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchQuotationConditionsSaleDto req, CancellationToken ct)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class PatchQuotationMessageEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/quotations/{@Id}/message", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchQuotationMessageDto req, CancellationToken ct)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class PatchQuotationProductQuantityEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/quotations/{@ProductId}/{@QuotationId}/Quantity", x => new { x.ProductId, x.QuotationId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchQuotationProductQuantityDto req, CancellationToken ct)
|
||||
|
||||
@@ -13,7 +13,8 @@ public class UpdateQuotationEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/quotations/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateQuotationDto req, CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class GetSettingEndpoint(SettingsRepository settingsRepository, AutoMappe
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/settings/");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,8 @@ public class PatchSettingElectronicSignatureEndpoint(SettingsRepository settings
|
||||
{
|
||||
Patch("/settings/electronicSignature");
|
||||
AllowFormData();
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchSettingElectronicSignatureDto req, CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PatchSettingLogoEndpoint(SettingsRepository settingsRepository) : E
|
||||
{
|
||||
Patch("/settings/logo");
|
||||
AllowFormData();
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchSettingLogoDto req, CancellationToken ct)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class AddProductToSupplierEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/suppliers/{@SupplierId}/{@ProductId}/", x => new { x.SupplierId, x.ProductId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreatePriceDto req, CancellationToken ct)
|
||||
|
||||
@@ -10,7 +10,7 @@ public class CreateSupplierEndpoint(SuppliersRepository suppliersRepository, Aut
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/suppliers");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateSupplierDto req, CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DeleteProductToSupplierEndpoint(PricesRepository pricesRepository)
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/suppliers/{@SupplierId}/{@Product}", x => new { x.SupplierId, x.ProductId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeletePriceRequest req, CancellationToken ct)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class DeleteSupplierEndpoint(SuppliersRepository suppliersRepository) : E
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/suppliers/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteSupplierRequest req, CancellationToken ct)
|
||||
|
||||
@@ -9,7 +9,7 @@ public class GetAllSuppliersEndpoint(SuppliersRepository suppliersRepository) :
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/suppliers");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GetSupplierEndpoint(SuppliersRepository suppliersRepository, AutoMa
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/suppliers/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetSupplierRequest req, CancellationToken ct)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class PatchPriceEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/prices/{@ProductId}/{@SupplierId}/SellingPrice", x => new { x.ProductId, x.SupplierId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchPriceSellingPriceDto req, CancellationToken ct)
|
||||
|
||||
@@ -12,7 +12,8 @@ public class PatchSupplierDeliveryDelayEndpoint(SuppliersRepository suppliersRep
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/suppliers/{@Id}/deliveryDelay", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchSupplierDeliveryDelayDto req, CancellationToken ct)
|
||||
|
||||
@@ -11,7 +11,7 @@ public class UpdateSupplierEndpoint(SuppliersRepository suppliersRepository, Aut
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/suppliers/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateSupplierDto req, CancellationToken ct)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class CreateUserEndpoint(UsersRepository usersRepository) : Endpoint<Crea
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/users");
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateUserDto req, CancellationToken ct)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class DeleteUserEndpoint(UsersRepository usersRepository) : Endpoint<Dele
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/users/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(DeleteUserRequest req, CancellationToken ct)
|
||||
|
||||
@@ -9,7 +9,7 @@ public class GetAllUsersEndpoint(UsersRepository usersRepository) : EndpointWith
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/users");
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GetUserEndpoint(UsersRepository usersRepository, AutoMapper.IMapper
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/users/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetUserRequest req, CancellationToken ct)
|
||||
|
||||
@@ -12,7 +12,7 @@ public class PatchUserPasswordEndpoint(UsersRepository usersRepository, AutoMapp
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/users/{@Id}/password", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchUserPasswordDto req, CancellationToken ct)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class UpdateUserEndpoint(UsersRepository usersRepository) : Endpoint<Upda
|
||||
public override void Configure()
|
||||
{
|
||||
Put("/users/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
Roles("Admin");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateUserDto req, CancellationToken ct)
|
||||
|
||||
@@ -9,7 +9,7 @@ public class GetAllWarehouseEndpoint(WareHouseRepository wareHouseRepository, Au
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/wareHouses/");
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GetTotalQuantityEndpoint(
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/wareHouseProducts/{@ProductId}", x => new { x.ProductId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetTotalQuantityRequest req, CancellationToken ct)
|
||||
|
||||
@@ -13,7 +13,7 @@ public class PatchWareHouseProductQuantityEndpoint(WarehouseProductsRepository w
|
||||
public override void Configure()
|
||||
{
|
||||
Patch("/wareHouseProducts/{@ProductId}/{@WareHouseId}/quantity", x => new { x.ProductId, x.WareHouseId });
|
||||
AllowAnonymous();
|
||||
Roles("Admin","Employe");
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(PatchWareHouseProductQuantityDto req, CancellationToken ct)
|
||||
|
||||
Reference in New Issue
Block a user