Skip to content

Commit

Permalink
Include SubjectRlation check
Browse files Browse the repository at this point in the history
  • Loading branch information
oanatmaria committed Oct 26, 2023
1 parent 507336c commit 0f9a01b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (d *Diff) validateRelationsTypes(relations []*RelationKind) error {
for objType, rels := range d.Removed.Relations {
for _, rel := range rels {
_, found := lo.Find(relations, func(rl *RelationKind) bool {
return rl.Object == objType && rl.Relation == rel
return (rl.Object == objType && rl.Relation == rel) || (rl.Subject == objType && rl.SubjectRelation == rel)
})
if found {
errs = multierror.Append(errs, errors.Wrapf(derr.ErrRelationTypeInUse, "object type [%s], relation type [%s]", objType, rel))
Expand Down

0 comments on commit 0f9a01b

Please sign in to comment.