Skip to content

Commit 4f62aac

Browse files
glpatcernjessegeens
authored andcommitted
Continuation of a4315ae for groups a user is member of
1 parent a4315ae commit 4f62aac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

user/rest.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,8 @@ func (m *manager) GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]stri
361361
return groups, nil
362362
}
363363

364-
// TODO (gdelmont): support pagination! we may have problems with users having more than 1000 groups
365-
url := fmt.Sprintf("%s/api/v1.0/Identity/%s/groups/recursive?field=displayName", m.conf.APIBaseURL, uid.OpaqueId)
366-
364+
// no pagination here because a user can be member of 1010 groups at most (Microsoft AD hardcoded limitation)
365+
url := fmt.Sprintf("%s/api/v1.0/Identity/%s/groups/recursive?filter=blocked%%3Afalse&filter=disabled%%3Afalse&field=displayName", m.conf.APIBaseURL, uid.OpaqueId)
367366
var r GroupsResponse
368367
if err := m.apiTokenManager.SendAPIGetRequest(ctx, url, false, &r); err != nil {
369368
return nil, err

0 commit comments

Comments
 (0)