diff --git a/src/pkg/services/m365/groups.go b/src/pkg/services/m365/groups.go index a32195c1c..6c659ceaf 100644 --- a/src/pkg/services/m365/groups.go +++ b/src/pkg/services/m365/groups.go @@ -54,6 +54,24 @@ func Groups( return getAllGroups(ctx, ac.Groups()) } +func GroupByID( + ctx context.Context, + acct account.Account, + id string, +) (*Group, error) { + ac, err := makeAC(ctx, acct, path.SharePointService) + if err != nil { + return nil, clues.Stack(err).WithClues(ctx) + } + + group, err := ac.Groups().GetByID(ctx, id) + if err != nil { + return nil, clues.Stack(err) + } + + return parseGroup(ctx, group) +} + func getAllGroups( ctx context.Context, ga getAller[models.Groupable],