Skip to content

Commit 9e0b1c2

Browse files
committed
Merge pull request #15784 from vpavic
* pr/15784: Remove duplicate code from HealthWebEndpointResponseMapper
2 parents c488934 + d7550d7 commit 9e0b1c2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapper.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -88,10 +88,7 @@ public WebEndpointResponse<Health> map(Health health,
8888
*/
8989
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext,
9090
ShowDetails showDetails) {
91-
if (showDetails == ShowDetails.NEVER
92-
|| (showDetails == ShowDetails.WHEN_AUTHORIZED
93-
&& (securityContext.getPrincipal() == null
94-
|| !isUserInRole(securityContext)))) {
91+
if (!canSeeDetails(securityContext, showDetails)) {
9592
health = Health.status(health.getStatus()).build();
9693
}
9794
return createWebEndpointResponse(health);

0 commit comments

Comments
 (0)