Fix grouping issues

pull/186/head
Rajitha Kumara 1 year ago
parent 3b4f159bf6
commit f2f37215da

@ -660,8 +660,12 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
private DeviceGroup findGroupFromTree(List<DeviceGroup> tree, int groupId) {
for (DeviceGroup node: tree) {
if (node.getGroupId() == groupId) return node;
if (node.getChildrenGroups() != null)
return findGroupFromTree(node.getChildrenGroups(), groupId);
if (node.getChildrenGroups() != null) {
DeviceGroup tempNode = findGroupFromTree(node.getChildrenGroups(), groupId);
if (tempNode != null) {
return tempNode;
}
}
}
return null;
}
@ -669,7 +673,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public DeviceGroup getUserOwnGroup(int groupId, boolean requireGroupProps, int depth) throws GroupManagementException {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
String username = ctx.getUsername();
String username = ctx.getUsername() + "@" + ctx.getTenantDomain(true);
int tenantId = ctx.getTenantId();
List<Integer> userOwnGroupIds = this.getGroupIds(username);
if (userOwnGroupIds == null) {

Loading…
Cancel
Save