Skip to content

Commit

Permalink
Merge pull request #103 from aserto-dev/bugfix/check-validation
Browse files Browse the repository at this point in the history
Fix conditionals in RelationIdentifiersExist
  • Loading branch information
ronenh authored Sep 25, 2024
2 parents c776bfe + 7e8ea42 commit 326f721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ds/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ func getRelations(ctx context.Context, tx *bolt.Tx) graph.RelationReader {
}

func (i *check) RelationIdentifiersExist(ctx context.Context, tx *bolt.Tx) error {
if i.relationIdentifierExist(
if !i.relationIdentifierExist(
ctx, tx, bdb.RelationsSubPath,
ObjectIdentifier(&dsc3.ObjectIdentifier{ObjectType: i.SubjectType, ObjectId: i.SubjectId}).Key(),
) {
return derr.ErrObjectNotFound.Msgf("subject %s:%s", i.SubjectType, i.SubjectId)
}

if i.relationIdentifierExist(
if !i.relationIdentifierExist(
ctx, tx, bdb.RelationsObjPath,
ObjectIdentifier(&dsc3.ObjectIdentifier{ObjectType: i.ObjectType, ObjectId: i.ObjectId}).Key(),
) {
Expand Down

0 comments on commit 326f721

Please sign in to comment.