public Search saveForUser(Search search, SearchUser searchUser) {
        this.executionGuard.check(search, searchUser::canReadStream);

        final Optional<Search> previous = Optional.ofNullable(search.id()).flatMap(dbService::get);
        if (!searchUser.isAdmin() && !previous.map(searchUser::owns).orElse(true)) {
            throw new PermissionException("Unable to update search with id <" + search.id() + ">, already exists and user is not permitted to overwrite it.");
        }

        return dbService.save(search.withOwner(searchUser.username()));
    }
@Test
    public void guardExceptionOnPostLeadsTo403() {
        final Search search = mockSearchWithOwner("someone");
        final SearchUser searchUser = mock(SearchUser.class);

        throwGuardExceptionFor(search);

        assertThatExceptionOfType(ForbiddenException.class)
                .isThrownBy(() -> sut.saveForUser(search, searchUser));
    }