Skip to content

Commit

Permalink
fix(acl): revert the error changed in #8937 (#8962)
Browse files Browse the repository at this point in the history
upgrade tests fail because of the change in the error. This PR undoes
the change in the error made in the PR #8937.
  • Loading branch information
mangalaman93 committed Nov 27, 2023
1 parent 1a37923 commit 59469e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ee/acl/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2793,13 +2793,13 @@ func (asuite *AclTestSuite) TestDeleteGrootAndGuardiansUsingDelNQuadShouldFail()
// Try deleting groot user
_, err = gc.Mutate(mu)
require.Error(t, err, "Deleting groot user should have returned an error")
require.Contains(t, err.Error(), "properties of guardians group and groot user cannot be deleted")
require.Contains(t, err.Error(), "Properties of guardians group and groot user cannot be deleted")

mu = &api.Mutation{DelNquads: []byte(fmt.Sprintf("%s %s %s .", "<"+guardiansUid+">", "*", "*")), CommitNow: true}
// Try deleting guardians group
_, err = gc.Mutate(mu)
require.Error(t, err, "Deleting guardians group should have returned an error")
require.Contains(t, err.Error(), "properties of guardians group and groot user cannot be deleted")
require.Contains(t, err.Error(), "Properties of guardians group and groot user cannot be deleted")
}

func deleteGuardiansGroupAndGrootUserShouldFail(t *testing.T, hc *dgraphtest.HTTPClient) {
Expand Down
2 changes: 1 addition & 1 deletion query/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func checkIfDeletingAclOperation(ctx context.Context, edges []*pb.DirectedEdge)
}
}
if isDeleteAclOperation {
return errors.Errorf("Reserved properties of guardians group and groot user cannot be deleted.")
return errors.Errorf("Reserved Properties of guardians group and groot user cannot be deleted.")
}
return nil
}
2 changes: 1 addition & 1 deletion systest/bgindex/count_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestCountIndex(t *testing.T) {
CommitNow: true,
DelNquads: []byte(fmt.Sprintf(`<%v> <value> "%v" .`, uid, ec-1)),
}); err != nil && (errors.Is(err, dgo.ErrAborted) ||
strings.Contains(err.Error(), "properties of guardians group and groot user cannot be deleted")) {
strings.Contains(err.Error(), "Properties of guardians group and groot user cannot be deleted")) {
return
} else if err != nil {
t.Fatalf("error in deletion :: %v\n", err)
Expand Down

0 comments on commit 59469e6

Please sign in to comment.