@Test void testDeleteAllStreamPermissionDenied() { initPermissionServiceMock(EntityTypePermission.DELETE_DATA, false); Stream<Object> entityIdStream = Stream.empty(); Exception exception = assertThrows( EntityTypePermissionDeniedException.class, () -> repositorySecurityDecorator.deleteAll(entityIdStream)); assertThat(exception.getMessage()) .containsPattern("permission:DELETE_DATA entityTypeId:entityTypeId"); }
@Override public void deleteAll(Stream<Object> ids) { EntityType entityType = delegate().getEntityType(); validatePermission(entityType, DELETE_DATA); delegate().deleteAll(ids); }
RepositorySecurityDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { EntityType entityType = delegate().getEntityType(); validatePermission(entityType, DELETE_DATA); delegate().deleteAll(ids); } }
RepositorySecurityDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { EntityType entityType = delegate().getEntityType(); validatePermission(entityType, DELETE_DATA); delegate().deleteAll(ids); } RepositorySecurityDecorator(
      Repository<Entity> delegateRepository, UserPermissionEvaluator permissionService); }
RepositorySecurityDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { EntityType entityType = delegate().getEntityType(); validatePermission(entityType, DELETE_DATA); delegate().deleteAll(ids); } RepositorySecurityDecorator(
      Repository<Entity> delegateRepository, UserPermissionEvaluator permissionService); @Override Iterator<Entity> iterator(); @Override void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize); @Override void close(); @Override long count(Query<Entity> q); @Override Stream<Entity> findAll(Query<Entity> q); @Override Entity findOne(Query<Entity> q); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); @Override long count(); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override AggregateResult aggregate(AggregateQuery aggregateQuery); }
RepositorySecurityDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { EntityType entityType = delegate().getEntityType(); validatePermission(entityType, DELETE_DATA); delegate().deleteAll(ids); } RepositorySecurityDecorator(
      Repository<Entity> delegateRepository, UserPermissionEvaluator permissionService); @Override Iterator<Entity> iterator(); @Override void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize); @Override void close(); @Override long count(Query<Entity> q); @Override Stream<Entity> findAll(Query<Entity> q); @Override Entity findOne(Query<Entity> q); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); @Override long count(); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override AggregateResult aggregate(AggregateQuery aggregateQuery);  }