Update Group Helpers to use new Group Contains

This commit is contained in:
Samuel Lorch 2022-01-21 11:49:39 +01:00
parent d84e7e7ad7
commit f3fe6eb1c5

View file

@ -49,7 +49,9 @@ func CreateGroup(ctx context.Context, c *api.Client, name string, operations []G
func GetGroup(ctx context.Context, c *api.Client, groupID string) (string, []GroupMembership, error) { func GetGroup(ctx context.Context, c *api.Client, groupID string) (string, []GroupMembership, error) {
// for some reason the groups index api call does not give back the groups_users even though it is supposed to, so i have to do this... // for some reason the groups index api call does not give back the groups_users even though it is supposed to, so i have to do this...
groups, err := c.GetGroups(ctx, &api.GetGroupsOptions{ groups, err := c.GetGroups(ctx, &api.GetGroupsOptions{
ContainGroupUser: true, ContainGroupsUsers: true,
ContainGroupsUsersUser: true,
ContainGroupsUsersUserProfile: true,
}) })
if err != nil { if err != nil {
return "", nil, fmt.Errorf("Getting Groups: %w", err) return "", nil, fmt.Errorf("Getting Groups: %w", err)
@ -77,7 +79,7 @@ func GetGroup(ctx context.Context, c *api.Client, groupID string) (string, []Gro
func UpdateGroup(ctx context.Context, c *api.Client, groupID, name string, operations []GroupMembershipOperation) error { func UpdateGroup(ctx context.Context, c *api.Client, groupID, name string, operations []GroupMembershipOperation) error {
// for some reason the groups index api call does not give back the groups_users even though it is supposed to, so i have to do this... // for some reason the groups index api call does not give back the groups_users even though it is supposed to, so i have to do this...
groups, err := c.GetGroups(ctx, &api.GetGroupsOptions{ groups, err := c.GetGroups(ctx, &api.GetGroupsOptions{
ContainGroupUser: true, ContainGroupsUsers: true,
}) })
if err != nil { if err != nil {
return fmt.Errorf("Getting Groups: %w", err) return fmt.Errorf("Getting Groups: %w", err)