@Test void testDeleteAllStream() { String entityTypeId = "entityTypeId"; EntityType entityType = when(mock(EntityType.class).getId()).thenReturn(entityTypeId).getMock(); when(delegateRepository.getEntityType()).thenReturn(entityType); Object entityId = "entityId"; when(userPermissionEvaluator.hasPermission( new EntityIdentity(entityTypeId, entityId), EntityPermission.DELETE)) .thenReturn(true); rowLevelSecurityRepositoryDecorator.deleteAll(Stream.of(entityId)); @SuppressWarnings("unchecked") ArgumentCaptor<Stream<Object>> entityStreamCaptor = ArgumentCaptor.forClass(Stream.class); verify(delegateRepository).deleteAll(entityStreamCaptor.capture()); assertEquals(singletonList(entityId), entityStreamCaptor.getValue().collect(toList())); verify(mutableAclService).deleteAcl(new EntityIdentity(entityTypeId, entityId), true); }
@Override public void deleteAcl(Entity entity) { EntityIdentity entityIdentity = new EntityIdentity(entity); deleteAcl(entityIdentity); }
RowLevelSecurityRepositoryDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Entity> { @Override public void deleteAcl(Entity entity) { EntityIdentity entityIdentity = new EntityIdentity(entity); deleteAcl(entityIdentity); } }
RowLevelSecurityRepositoryDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Entity> { @Override public void deleteAcl(Entity entity) { EntityIdentity entityIdentity = new EntityIdentity(entity); deleteAcl(entityIdentity); } RowLevelSecurityRepositoryDecorator(
      Repository<Entity> delegateRepository,
      UserPermissionEvaluator userPermissionEvaluator,
      MutableAclService mutableAclService); }
RowLevelSecurityRepositoryDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Entity> { @Override public void deleteAcl(Entity entity) { EntityIdentity entityIdentity = new EntityIdentity(entity); deleteAcl(entityIdentity); } RowLevelSecurityRepositoryDecorator(
      Repository<Entity> delegateRepository,
      UserPermissionEvaluator userPermissionEvaluator,
      MutableAclService mutableAclService); @Override boolean isActionPermitted(Entity entity, Action operation); @Override boolean isActionPermitted(Object id, Action operation); @Override void throwPermissionException(Entity entity, Action action); @Override void createAcl(Entity entity); @Override void deleteAcl(Entity entity); @Override void deleteAcl(Object id); @Override void updateAcl(Entity entity); }
RowLevelSecurityRepositoryDecorator extends AbstractRowLevelSecurityRepositoryDecorator<Entity> { @Override public void deleteAcl(Entity entity) { EntityIdentity entityIdentity = new EntityIdentity(entity); deleteAcl(entityIdentity); } RowLevelSecurityRepositoryDecorator(
      Repository<Entity> delegateRepository,
      UserPermissionEvaluator userPermissionEvaluator,
      MutableAclService mutableAclService); @Override boolean isActionPermitted(Entity entity, Action operation); @Override boolean isActionPermitted(Object id, Action operation); @Override void throwPermissionException(Entity entity, Action action); @Override void createAcl(Entity entity); @Override void deleteAcl(Entity entity); @Override void deleteAcl(Object id); @Override void updateAcl(Entity entity);  }