use of com.salesmanager.shop.populator.user.ReadableUserPopulator in project shopizer by shopizer-ecommerce.
the class UserFacadeImpl method convertUserToReadableUser.
private ReadableUser convertUserToReadableUser(Language lang, User user) {
ReadableUserPopulator populator = new ReadableUserPopulator();
try {
ReadableUser readableUser = new ReadableUser();
readableUser = populator.populate(user, readableUser, user.getMerchantStore(), lang);
List<Integer> groupIds = readableUser.getGroups().stream().map(ReadableGroup::getId).map(Long::intValue).collect(Collectors.toList());
List<ReadablePermission> permissions = findPermissionsByGroups(groupIds);
readableUser.setPermissions(permissions);
return readableUser;
} catch (ConversionException e) {
throw new ConversionRuntimeException(e);
}
}
Aggregations