|
|
|
@ -91,12 +91,12 @@ class CloudFoundryWebEndpointServletHandlerMapping
|
|
|
|
|
}
|
|
|
|
|
AccessLevel accessLevel = (AccessLevel) request
|
|
|
|
|
.getAttribute(AccessLevel.REQUEST_ATTRIBUTE);
|
|
|
|
|
Map<String, Link> links = CloudFoundryWebEndpointServletHandlerMapping.this.linksResolver
|
|
|
|
|
.resolveLinks(request.getRequestURL().toString());
|
|
|
|
|
Map<String, Link> filteredLinks = new LinkedHashMap<>();
|
|
|
|
|
if (accessLevel == null) {
|
|
|
|
|
return Collections.singletonMap("_links", filteredLinks);
|
|
|
|
|
}
|
|
|
|
|
Map<String, Link> links = CloudFoundryWebEndpointServletHandlerMapping.this.linksResolver
|
|
|
|
|
.resolveLinks(request.getRequestURL().toString());
|
|
|
|
|
filteredLinks = links.entrySet().stream()
|
|
|
|
|
.filter((e) -> e.getKey().equals("self")
|
|
|
|
|
|| accessLevel.isAccessAllowed(e.getKey()))
|
|
|
|
|