-
-
Save dcomartin/7a8adc8ab5972e05a46676bf9794b8b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var builder = WebApplication.CreateBuilder(args); | |
| builder.Services.AddEndpointsApiExplorer(); | |
| builder.Services.AddSwaggerGen(); | |
| builder.Services.AddAuthorization(options => | |
| { | |
| options.AddPolicy("DispatchManagerOnly", policy => | |
| policy.RequireRole("DispatchManager")); | |
| }); | |
| var app = builder.Build(); | |
| app.UseHttpsRedirection(); | |
| app.MapPost("/shipments/assign", () => "Assign shipments to dispatchers logic is here...") | |
| .RequireAuthorization("DispatchManagerOnly"); | |
| app.Run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment