Put roles into endpoints

This commit is contained in:
Cristiano
2026-05-28 15:36:33 +02:00
parent fc9da89ebe
commit 5869ae18c4
61 changed files with 68 additions and 61 deletions
@@ -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)