Review fix
This commit is contained in:
parent
a6241958fb
commit
892ad65d79
1 changed files with 2 additions and 3 deletions
|
@ -32,8 +32,6 @@ public class AccessController implements AuthorizationApi {
|
|||
private final AccessControlService accessControlService;
|
||||
|
||||
public Mono<ResponseEntity<AuthenticationInfoDTO>> getUserAuthInfo(ServerWebExchange exchange) {
|
||||
AuthenticationInfoDTO dto = new AuthenticationInfoDTO(accessControlService.isRbacEnabled());
|
||||
|
||||
Mono<List<UserPermissionDTO>> permissions = accessControlService.getUser()
|
||||
.map(user -> accessControlService.getRoles()
|
||||
.stream()
|
||||
|
@ -51,10 +49,11 @@ public class AccessController implements AuthorizationApi {
|
|||
return userName
|
||||
.zipWith(permissions)
|
||||
.map(data -> {
|
||||
var dto = new AuthenticationInfoDTO(accessControlService.isRbacEnabled());
|
||||
dto.setUserInfo(new UserInfoDTO(data.getT1(), data.getT2()));
|
||||
return dto;
|
||||
})
|
||||
.switchIfEmpty(Mono.just(dto))
|
||||
.switchIfEmpty(Mono.just(new AuthenticationInfoDTO(accessControlService.isRbacEnabled())))
|
||||
.map(ResponseEntity::ok);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue