Skip to content

Commit

Permalink
Fetch page access levels for a group once instead of re-fetching for …
Browse files Browse the repository at this point in the history
…every member of a group.
  • Loading branch information
ggreer committed Feb 14, 2024
1 parent ad57112 commit 9edb4a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/connector/pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ func (s *pageSyncer) Grants(ctx context.Context, resource *v2.Resource, pToken *
return nil, "", nil, err
}

pageAccessLevels, err := s.pageAccessLevelsForGroup(ctx, page, group)
if err != nil {
return nil, "", nil, err
}

for _, m := range members {
if m.GetUserID() == 0 {
l.Debug("member did not have user ID defined -- skipping")
continue
}

pageAccessLevels, err := s.pageAccessLevelsForGroup(ctx, page, group)
if err != nil {
return nil, "", nil, err
}

principalID := &v2.ResourceId{
ResourceType: resourceTypeUser.Id,
Resource: formatObjectID(resourceTypeUser.Id, m.GetUserID()),
Expand Down

0 comments on commit 9edb4a7

Please sign in to comment.