|
|
|
@ -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) {
|
|
|
|
|