I have following bean
@Bean
public GroupedOpenApi myGroup1() {
return GroupedOpenApi.builder()
.group("My Group 1")
.pathsToMatch("/api/group1/**")
.build();
}
I have also swagger-ui, which is accessible for service users, and for service admins too. There's several different GroupedOpenApi, many of them is accessible for everyone. But thisone, "My Group 1", I want to be accessible in Swagger-ui to admins only. When admin goes to Swagger-ui , he has role ADMIN and he will see "My Group 1". When standard user goes to Swagger-ui (and he does not have role ADMIN) then he will NOT even see "My Group 1".
I know I can control access to the endpoints and reject requests on these endpoints from non-admin users. I am strugeling with springfox openapi and swagger configuration. I googled a lot and I still have no idea how to achieve my goal.