Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions pages/spicedb/concepts/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,31 @@ definition document {

### Operations

<Callout type="warning">
**Important: Union Precedence**

For historical reasons, union (`+`) takes precedence over intersection (`&`) and exclusion (`-`), which can lead to unexpected results.
For example, `a + b & c` is evaluated as `(a + b) & c`, not `a + (b & c)`.

We intend to add a flag to fix this precedence issue in the future.

It is highly recommended to either:

- Break complex expressions into intermediate permissions:

```zed
permission writers_and_admins = writer & admin
permission view = reader + writers_and_admins
```

- Use explicit parentheses to clarify precedence:

```zed
permission view = reader + (writer & admin)
```

</Callout>

Permissions support four kinds of operations: **union**, **intersection**, **exclusion** and **arrow**.

#### `+` (Union)
Expand Down