fix: allow generic groups to be returned when searching the organization
@@ -113,19 +113,27 @@ func getGroupsForDescriptor(clients *client.AggregatedClient, projectDescriptor
if err != nil {
return nil, err
}
+
if newGroups != nil && len(*newGroups) > 0 {
if projectDescriptor == "" {
// filter on collection groups
filteredGroups := []graph.GraphGroup{}
for _, grp := range *newGroups {
- if grp.Domain != nil && strings.HasPrefix(strings.ToLower(*grp.Domain), "vstfs:///framework/identitydomain") {
- filteredGroups = append(filteredGroups, grp)
+ if grp.Domain == nil {
+ continue
}
+
+ domain := strings.ToLower(*grp.Domain)
+ if strings.HasPrefix(domain, "vstfs:///framework/identitydomain") ||
+ (strings.HasPrefix(domain, "vstfs:///framework/generic")) {
+ filteredGroups = append(filteredGroups, grp)
}
- newGroups = &filteredGroups
}
+ groups = append(groups, filteredGroups...)
+ } else {
groups = append(groups, *newGroups...)
}
+ }
hasMore = currentToken != ""
}
