parent
3642636b60
commit
3c9cee2a8c
|
@ -65,13 +65,13 @@ public class HealthWebEndpointResponseMapper {
|
||||||
*/
|
*/
|
||||||
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext,
|
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext,
|
||||||
ShowDetails showDetails) {
|
ShowDetails showDetails) {
|
||||||
Integer status = this.statusHttpMapper.mapStatus(health.getStatus());
|
|
||||||
if (showDetails == ShowDetails.NEVER
|
if (showDetails == ShowDetails.NEVER
|
||||||
|| (showDetails == ShowDetails.WHEN_AUTHORIZED
|
|| (showDetails == ShowDetails.WHEN_AUTHORIZED
|
||||||
&& (securityContext.getPrincipal() == null
|
&& (securityContext.getPrincipal() == null
|
||||||
|| !isUserInRole(securityContext)))) {
|
|| !isUserInRole(securityContext)))) {
|
||||||
health = Health.status(health.getStatus()).build();
|
health = Health.status(health.getStatus()).build();
|
||||||
}
|
}
|
||||||
|
Integer status = this.statusHttpMapper.mapStatus(health.getStatus());
|
||||||
return new WebEndpointResponse<>(health, status);
|
return new WebEndpointResponse<>(health, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue