Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
7.20.0.Final, 7.25.0.Final
-
None
-
NEW
-
NEW
-
Description
As per the current code implementation, I can't be able to filter task list based on user group passed in the kie server pot-owners API.
I looked at the code, we are not using the group name which passed in the API while filtering task list,
Current Code:
@Override
public List getTasksAssignedAsPotentialOwner(String userId, List groupIds, QueryFilter filter)
public static List getCallbackUserRoles(UserGroupCallback userGroupCallback, String userId) {
List roles = userGroupCallback != null ? userGroupCallback.getGroupsForUser(userId) : new ArrayList<>();
if (roles == null || roles.isEmpty())
return roles;
}
But the actual code will be look like below,
@Override
public List getTasksAssignedAsPotentialOwner(String userId, List groupIds, QueryFilter filter) {
Map<String, Object> params = new HashMap<String, Object>();
// params.put("groupIds", mergeLists(groupIds, getCallbackUserRoles(userGroupCallback, userId)));
if (groupIds == null || groupIds.isEmpty())
else
params.put("groupIds", filteredUserGroups(groupIds, getCallbackUserRoles(userGroupCallback, userId)));
applyQueryContext(params, filter);
applyQueryFilter(params, filter);
return (List) commandService
.execute(new QueryNameCommand<List>("TasksAssignedAsPotentialOwnerWithGroups", params));
}
private List filteredUserGroups(List groupIds, List callbackUserRoles) {
List data = new ArrayList();
for (String groupId : groupIds)
return data;
}