@Override
    public Set<String> requiredPermissions() {
        // When there are no streams the event processor will search in all streams so we need to require the
        // generic stream permission.
        if (streams().isEmpty()) {
            return Collections.singleton(RestPermissions.STREAMS_READ);
        }
        return streams().stream()
                .map(streamId -> String.join(":", RestPermissions.STREAMS_READ, streamId))
                .collect(Collectors.toSet());
    }
@Test
    @MongoDBFixtures("aggregation-processors.json")
    public void requiredPermissions() {
        assertThat(dbService.get("54e3deadbeefdeadbeefaffe")).get().satisfies(definition ->
                assertThat(definition.config().requiredPermissions()).containsOnly("streams:read:stream-a", "streams:read:stream-b"));
    }