diff --git a/pkg/development/warningdefs.go b/pkg/development/warningdefs.go index cf5c9dae00..69c6176372 100644 --- a/pkg/development/warningdefs.go +++ b/pkg/development/warningdefs.go @@ -196,6 +196,11 @@ var lintArrowReferencingRelation = ttuCheck{ } for _, subjectType := range allowedSubjectTypes { + // Skip for arrow referencing relations in the same namespace. + if subjectType.Namespace == ts.Namespace().Name { + continue + } + nts, err := ts.TypeSystemForNamespace(ctx, subjectType.Namespace) if err != nil { return nil, err diff --git a/pkg/development/warnings_test.go b/pkg/development/warnings_test.go index 7385d6ba5e..398a2d50d2 100644 --- a/pkg/development/warnings_test.go +++ b/pkg/development/warnings_test.go @@ -202,6 +202,18 @@ func TestWarnings(t *testing.T) { SourceCode: "view", }, }, + { + name: "arrow referencing relation in the same namespace", + schema: `definition user {} + + definition document { + relation parent: document + relation viewer: user + permission view = parent->viewer + } + `, + expectedWarning: nil, + }, } for _, tc := range tcs {