use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class LDAPUserGroupCallbackImplTest method testGroupExistsDefaultProperties.
@Test
public void testGroupExistsDefaultProperties() {
UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.DEFAULT);
Assertions.assertThat(ldapUserGroupCallback).isNotNull();
boolean groupExists = ldapUserGroupCallback.existsGroup("manager");
Assertions.assertThat(groupExists).isTrue();
}
use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class UserTaskPotOwnerQueryBuilder method build.
@Override
public ColumnFilter build() {
// return null if it was already invoked
if (built) {
return null;
}
String columnName = "potOwner";
UserGroupCallback userGroupCallback = UserDataServiceProvider.getUserGroupCallback();
List<String> potOwners = (List<String>) parameters.get(columnName);
List<String> potOwnersList = new ArrayList<String>();
for (String potOwner : potOwners) {
potOwnersList.add(potOwner);
List<String> groups = userGroupCallback.getGroupsForUser(potOwner);
if (groups != null) {
potOwnersList.addAll(groups);
}
}
ColumnFilter filter = FilterFactory.AND(FilterFactory.in(columnName, potOwnersList));
filter.setColumnId(columnName);
built = true;
return filter;
}
Aggregations