Skip to content

Commit

Permalink
check-relation object type propapagtion
Browse files Browse the repository at this point in the history
  • Loading branch information
gertd committed Aug 16, 2023
1 parent 761ea67 commit 5fb383a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/ds/check_relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ func (i *checkRelation) Validate() (bool, error) {
return ok, err
}

if ok, err := RelationTypeIdentifier(i.CheckRelationRequest.Relation).Validate(); !ok {
if ok, err := ObjectIdentifier(i.CheckRelationRequest.Subject).Validate(); !ok {
return ok, err
}

if ok, err := ObjectIdentifier(i.CheckRelationRequest.Subject).Validate(); !ok {
RECHECK:
if ok, err := RelationTypeIdentifier(i.CheckRelationRequest.Relation).Validate(); !ok {
if i.CheckRelationRequest.Relation.GetObjectType() == "" {
i.CheckRelationRequest.Relation.ObjectType = i.CheckRelationRequest.Object.Type
goto RECHECK
}
return ok, err
}

Expand Down

0 comments on commit 5fb383a

Please sign in to comment.