BAEL-2443: jsonview spring security (#6291)
* BAEL-2443: Implement filtering with @JsonView based on spring security role * Cleanup test * Rename tests * Fix renaming roles after refactoring * BAEL-2443: Restore return statement in controller advice
This commit is contained in:
parent
582bb8a3d5
commit
1f244261d0
|
@ -31,6 +31,7 @@ public class SecurityJsonViewControllerAdvice extends AbstractMappingJacksonResp
|
|||
.collect(Collectors.toList());
|
||||
if (jsonViews.size() == 1) {
|
||||
bodyContainer.setSerializationView(jsonViews.get(0));
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Ambiguous @JsonView declaration for roles "+ authorities.stream().map(GrantedAuthority::getAuthority).collect(Collectors.joining(",")));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue