@Override
    public Optional<UserInfo> getUserInfoByUserUuid(final String userUuid) {
        Objects.requireNonNull(userUuid);
        // Left join to stroom_user, so we can get the enabled state
        return JooqUtil.contextResult(securityDbConnProvider, context -> context
                        .select(
                                STROOM_USER_ARCHIVE.NAME,
                                STROOM_USER_ARCHIVE.DISPLAY_NAME,
                                STROOM_USER_ARCHIVE.FULL_NAME,
                                STROOM_USER_ARCHIVE.IS_GROUP,
                                STROOM_USER.ENABLED,
                                STROOM_USER.ID)
                        .from(STROOM_USER_ARCHIVE)
                        .leftOuterJoin(STROOM_USER).on(STROOM_USER_ARCHIVE.UUID.eq(STROOM_USER.UUID))
                        .where(STROOM_USER_ARCHIVE.UUID.eq(userUuid))
                        .fetchOptional())
                .map(rec -> UserInfo.builder()
                        .uuid(userUuid)
                        .subjectId(rec.get(STROOM_USER_ARCHIVE.NAME))
                        .displayName(rec.get(STROOM_USER_ARCHIVE.DISPLAY_NAME))
                        .fullName(rec.get(STROOM_USER_ARCHIVE.FULL_NAME))
                        .group(rec.get(STROOM_USER_ARCHIVE.IS_GROUP))
                        .enabled(Objects.requireNonNullElse(rec.get(STROOM_USER.ENABLED), false))
                        .deleted(rec.get(STROOM_USER.ID) == null)
                        .build());
    }
IMPORTANT - This must be called after any insert/update to STROOM_USER (and
as part of the same txn) to ensure STROOM_USER_ARCHIVE is up-to-date.
NOT to be called after a delete statement as we want to preserve the details
of deleted users.
stroom-security/stroom-security-impl-db/src/main/java/stroom/security/impl/db/UserDaoImpl.java