list the api in swagger based on user roles
问题 I have a requirement where I want to list the api methods in swagger based on user roles. For example :- User A with basic access can use limited api methods. User B with Admin access can use all the listed api methods. I don't know how to achieve this. I am using Swashbuckle.AspNetCore Version="1.0.0" 回答1: Try using an IDocumentFilter, you can limit what the user gets in the SwaggerDocument and the swagger-ui feeds from that. Here are some examples https://github.com/heldersepu