Skip to content

Commit

Permalink
Clarify partial reference behavior (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 authored Feb 7, 2025
1 parent e0a43b9 commit 5b8d65d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pages/spicedb/modeling/composable-schemas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,18 @@ This syntax:

```zed
partial view_partial {
relation user: user
permission view = user
relation viewer: user
permission view = viewer
}
partial edit_partial {
relation editor: user
permission edit = editor
}
definition resource {
...view_partial
...edit_partial
}
```

Expand All @@ -163,6 +169,9 @@ is equivalent to this declaration:
definition resource {
relation user: user
permission view = user
relation editor: user
permission edit = editor
}
```

Expand All @@ -172,6 +181,7 @@ definition resource {
* Circular references between partials are treated as errors.
* You can only reference partial declarations.
Attempting to reference other declaration types (e.g. a definition or a caveat) with a partial reference will result in a error.
* A partial can be referenced any number of times, and a partial or definition can contain any number of partial references.

## An Example Workflow

Expand Down

0 comments on commit 5b8d65d

Please sign in to comment.