class DeploymentIdsPreprocessor implements DataSetPreprocessor {

    @Override
    public void preprocess(DataSetLookup lookup) {
        if (identityProvider == null) {
            return;
        }

        final List<String> deploymentIds = deploymentRolesManager.getDeploymentsForUser(identityProvider);
        ColumnFilter columnFilter;
        if(deploymentIds != null  && !deploymentIds.isEmpty()){
            columnFilter = in(columnId, deploymentIds);
        }  else {
            columnFilter = equalsTo(impossibleConditionColumnId,-1);
        }

        LOGGER.debug("Adding column filter: {}", columnFilter);

        if (lookup.getFirstFilterOp() != null) {
            lookup.getFirstFilterOp().addFilterColumn(columnFilter);
        } else {
            DataSetFilter filter = new DataSetFilter();
            filter.addFilterColumn(columnFilter);
            lookup.addOperation(filter);
        }
    }

    public  DeploymentIdsPreprocessor(DeploymentRolesManager deploymentRolesManager,
                                     IdentityProvider identityProvider,
                                     String columnId,
                                     String impossibleConditionColumnId);

}