use of org.jbpm.services.api.query.QueryResultMapper.COLUMN_ORGANIZATIONAL_ENTITY 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);
}
Aggregations