use of com.synopsys.integration.alert.common.enumeration.AuthenticationType in project hub-alert by blackducksoftware.
the class DefaultUserAccessor method createModel.
private UserModel createModel(UserEntity user) {
List<UserRoleRelation> roleRelations = userRoleRepository.findAllByUserId(user.getId());
List<Long> roleIdsForUser = roleRelations.stream().map(UserRoleRelation::getRoleId).collect(Collectors.toList());
Set<UserRoleModel> roles = roleAccessor.getRoles(roleIdsForUser);
AuthenticationType authenticationType = authenticationTypeAccessor.getAuthenticationType(user.getAuthenticationType()).orElse(null);
return UserModel.existingUser(user.getId(), user.getUserName(), user.getPassword(), user.getEmailAddress(), authenticationType, roles, user.isEnabled());
}
Aggregations