use of org.dashbuilder.dataset.filter.DataSetFilter in project jbpm by kiegroup.
the class BusinessAdminTasksPreprocessor method preprocess.
@SuppressWarnings("rawtypes")
@Override
public void preprocess(DataSetLookup lookup) {
if (identityProvider == null) {
return;
}
if (ADMIN_USER.equals(identityProvider.getName()) || identityProvider.getRoles().stream().filter(s -> s.equals(ADMIN_GROUP)).findFirst().isPresent()) {
return;
}
final List<Comparable> orgEntities = new ArrayList<Comparable>(identityProvider.getRoles());
orgEntities.add(identityProvider.getName());
final ColumnFilter columnFilter = equalsTo(COLUMN_ORGANIZATIONAL_ENTITY, orgEntities);
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);
}
super.preprocess(lookup);
}
use of org.dashbuilder.dataset.filter.DataSetFilter in project jbpm by kiegroup.
the class DeploymentIdsPreprocessor method preprocess.
@Override
public void preprocess(DataSetLookup lookup) {
if (identityProvider == null) {
return;
}
final List<String> deploymentIds = deploymentRolesManager.getDeploymentsForUser(identityProvider);
final ColumnFilter columnFilter = in(columnId, deploymentIds);
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);
}
}
use of org.dashbuilder.dataset.filter.DataSetFilter in project jbpm by kiegroup.
the class PotOwnerTasksPreprocessor method preprocess.
@SuppressWarnings("rawtypes")
@Override
public void preprocess(DataSetLookup lookup) {
if (identityProvider == null) {
return;
}
final List<Comparable> orgEntities = new ArrayList<Comparable>(identityProvider.getRoles());
orgEntities.add(identityProvider.getName());
final ColumnFilter myGroupFilter = AND(equalsTo(COLUMN_ORGANIZATIONAL_ENTITY, orgEntities), OR(equalsTo(COLUMN_ACTUALOWNER, ""), isNull(COLUMN_ACTUALOWNER)));
final ColumnFilter columnFilter = AND(OR(isNull(COLUMN_EXCLUDED_OWNER), notEqualsTo(COLUMN_EXCLUDED_OWNER, identityProvider.getName())), OR(myGroupFilter, equalsTo(COLUMN_ACTUALOWNER, identityProvider.getName())));
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);
}
super.preprocess(lookup);
}
Aggregations