diff --git a/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs b/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs index 75503af..4fc3e17 100644 --- a/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs +++ b/PyroFetes/Endpoints/Customers/GetAllCustomersEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs index f531045..c78bb26 100644 --- a/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/CreateDelivererEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs index 31ee092..df8c6bc 100644 --- a/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/DeleteDelivererEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs index b30d02f..b635ef7 100644 --- a/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/GetAllDelivererEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs index 640d0c2..bc6b259 100644 --- a/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/GetDelivererEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs b/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs index a9b38f5..c9fd77c 100644 --- a/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs +++ b/PyroFetes/Endpoints/Deliverers/UpdateDelivererEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs index 36335bf..01834a7 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/CreateDeliveryNoteEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs index bc14d89..b2c9f7b 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/DeleteDeliveryNoteEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs index 4fbadbe..480983d 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNoteEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs index 07cdaeb..7693ac9 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetAllDeliveryNotesNotArrivedEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs index 62597db..6088774 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNoteEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs index aaaaa7f..dfacbf6 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/GetDeliveryNotePdfEndpoint.cs @@ -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(200, MediaTypeNames.Application.Pdf)); } diff --git a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs index a710044..6bf0485 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/PatchRealDeliveryDateEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs index 6fccf9b..ecf3194 100644 --- a/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs +++ b/PyroFetes/Endpoints/DeliveryNotes/UpdateDeliveryNoteEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs index a772064..f8465e7 100644 --- a/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/DeleteProductEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs index e6c9343..5b36622 100644 --- a/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetAllProductsEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs index 0b9768f..a509256 100644 --- a/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetAllProductsUnderLimitEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Products/GetProductEndpoint.cs b/PyroFetes/Endpoints/Products/GetProductEndpoint.cs index efe2a7b..277e90e 100644 --- a/PyroFetes/Endpoints/Products/GetProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/GetProductEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs index dc2229f..1a27b21 100644 --- a/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs +++ b/PyroFetes/Endpoints/Products/PatchProductMinimalStockEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs b/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs index 81fccdd..ee43e99 100644 --- a/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs +++ b/PyroFetes/Endpoints/Products/UpdateProductEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs index 9a02d20..9df4f09 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/AddProductFromPurchaseOrderEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs index 28fc2a4..3947e32 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/CreatePurchaseOrder.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs index 8f6274e..ce6505d 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/DeleteProductFromPurchaseOrderEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs index b3f077c..a0fe2f1 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/DeletePurchaseOrderEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs index 09d7dcb..6d42c0f 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetAllPurchaseOrderEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs index c9d906c..9c39ce4 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs index 2385163..a532874 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/GetPurchaseOrderPdfEndpoint.cs @@ -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(200, MediaTypeNames.Application.Pdf)); } diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs index 0adbae4..f8a516a 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseOrderPurchaseConditionsEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs index fe32641..3c28f91 100644 --- a/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/PurchaseOrders/PatchPurchaseProductQuantityEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs index 8a6c9f4..731d1f6 100644 --- a/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/AddProductoToQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index 4dfcda5..2f04dee 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs index 569694e..a857879 100644 --- a/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/DeleteProductFromQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs index 737fa9e..e26b7ba 100644 --- a/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/DeleteQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs index bccafd3..d8a0f2d 100644 --- a/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetAllQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs index bc4b4fa..d22200e 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs index 434ddcf..4b015d9 100644 --- a/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/GetQuotationPdfEndpoint.cs @@ -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(200, MediaTypeNames.Application.Pdf)); } diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs index 203913f..827e2fb 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationConditionsSaleEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs index 066f831..542a54e 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationMessageEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs index f7cc233..1f1cff6 100644 --- a/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/PatchQuotationProductQuantityEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs index 4284b5d..eb5b4a2 100644 --- a/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/UpdateQuotationEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs index e10ce01..fedd96c 100644 --- a/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/GetSettingEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs index efd1808..624f7d7 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingElectronicSignatureEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs index 4047f19..d4a10d1 100644 --- a/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs +++ b/PyroFetes/Endpoints/Settings/PatchSettingLogoEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs index 657ee98..90942e2 100644 --- a/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/AddProductToSupplierEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs index 6a137e6..fa63a16 100644 --- a/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/CreateSupplierEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs index 8c2e514..8f70d79 100644 --- a/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/DeleteProductToSupplierEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs index 40f2655..163e42c 100644 --- a/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/DeleteSupplierEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs b/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs index 5a8bc28..faa0473 100644 --- a/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/GetAllSuppliersEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs index 29ba25a..258e720 100644 --- a/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/GetSupplierEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs index 38002f9..0b97a27 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchPriceEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs b/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs index b058225..0f230b8 100644 --- a/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/PatchSupplierDeliveryDelayEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs b/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs index d9f79f6..b55a8be 100644 --- a/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs +++ b/PyroFetes/Endpoints/Suppliers/UpdateSupplierEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs index a4f183a..517536b 100644 --- a/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/CreateUserEndpoint.cs @@ -13,7 +13,7 @@ public class CreateUserEndpoint(UsersRepository usersRepository) : Endpoint new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(DeleteUserRequest req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs b/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs index 46b5003..59731c3 100644 --- a/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetAllUsersEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs index c6b5d45..de2c368 100644 --- a/PyroFetes/Endpoints/Users/GetUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/GetUserEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs index 760ce32..5095ca0 100644 --- a/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs +++ b/PyroFetes/Endpoints/Users/PatchUserPasswordEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs index ead9dbb..7d5ae39 100644 --- a/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs +++ b/PyroFetes/Endpoints/Users/UpdateUserEndpoint.cs @@ -13,7 +13,7 @@ public class UpdateUserEndpoint(UsersRepository usersRepository) : Endpoint new { x.Id }); - AllowAnonymous(); + Roles("Admin"); } public override async Task HandleAsync(UpdateUserDto req, CancellationToken ct) diff --git a/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs index 50bf272..4cef069 100644 --- a/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouse/GetAllWarehouseEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs index f24ae3e..473480f 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs @@ -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) diff --git a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs index 9e6733f..2e1246f 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/PatchWareHouseProductQuantityEndpoint.cs @@ -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)