Skip to content

Commit

Permalink
fix: removing extra #member on assignIdentities service call
Browse files Browse the repository at this point in the history
closes #283
  • Loading branch information
shipperizer committed Apr 22, 2024
1 parent 77fcdfb commit bfde070
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/groups/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (s *Service) AssignIdentities(ctx context.Context, ID string, identities ..

for _, identity := range identities {
// TODO @shipperizer swap user for identity if/when model changes
ids = append(ids, *ofga.NewTuple(fmt.Sprintf("user:%s", identity), MEMBER_RELATION, s.buildGroupMember(ctx, ID)))
ids = append(ids, *ofga.NewTuple(fmt.Sprintf("user:%s", identity), MEMBER_RELATION, fmt.Sprintf("group:%s", ID)))
}

err := s.ofga.WriteTuples(ctx, ids...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/groups/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func TestServiceAssignIdentities(t *testing.T) {
ids := make([]ofga.Tuple, 0)

for _, i := range test.input.identities {
ids = append(ids, *ofga.NewTuple(fmt.Sprintf("user:%s", i), MEMBER_RELATION, fmt.Sprintf("group:%s#%s", test.input.group, MEMBER_RELATION)))
ids = append(ids, *ofga.NewTuple(fmt.Sprintf("user:%s", i), MEMBER_RELATION, fmt.Sprintf("group:%s", test.input.group)))
}

if !reflect.DeepEqual(ids, tuples) {
Expand Down

0 comments on commit bfde070

Please sign in to comment.