public Mono<ServicePermission> isAllowToQueryUserProfile(
            @NotNull Long requesterId,
            @NotNull Long targetUserId) {
        try {
            Validator.notNull(requesterId, "requesterId");
            Validator.notNull(targetUserId, "targetUserId");
        } catch (ResponseException e) {
            return Mono.error(e);
        }

        Mono<ProfileAccessStrategy> findProfileAccess =
                userRepository.findProfileAccessIfNotDeleted(targetUserId);
        if (!isUserCollectionBasedAuthEnabled) {
            findProfileAccess = findProfileAccess.defaultIfEmpty(ProfileAccessStrategy.ALL);
        }
        return findProfileAccess.flatMap(strategy -> switch (strategy) {
            case ALL -> Mono.just(ServicePermission.OK);
            case FRIENDS -> userRelationshipService
                    .hasRelationshipAndNotBlocked(targetUserId, requesterId, false)
                    .map(isRelatedAndAllowed -> isRelatedAndAllowed
                            ? ServicePermission.OK
                            : ServicePermission
                                    .get(ResponseStatusCode.NOT_FRIEND_TO_QUERY_USER_PROFILE));
            case ALL_EXCEPT_BLOCKED_USERS -> userRelationshipService
                    .isNotBlocked(targetUserId, requesterId, false)
                    .map(isNotBlocked -> isNotBlocked
                            ? ServicePermission.OK
                            : ServicePermission
                                    .get(ResponseStatusCode.BLOCKED_USER_TO_QUERY_USER_PROFILE));
            default -> Mono.error(ResponseException.get(ResponseStatusCode.SERVER_INTERNAL_ERROR,
                    "Unexpected profile access strategy: "
                            + strategy));
        })
                .switchIfEmpty(ResponseExceptionPublisherPool.resourceNotFound());
    }
@return Possible codes: {@link ResponseStatusCode#OK}
        {@link ResponseStatusCode#NOT_FRIEND_TO_QUERY_USER_PROFILE}
        {@link ResponseStatusCode#BLOCKED_USER_TO_QUERY_USER_PROFILE}
        {@link ResponseStatusCode#SERVER_INTERNAL_ERROR}
        {@link ResponseStatusCode#RESOURCE_NOT_FOUND}
turms-service/src/main/java/im/turms/service/domain/user/service/UserService.java