File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,31 @@ definition document {
177177
178178### Operations
179179
180+ <Callout type = " warning" >
181+ ** Important: Union Precedence**
182+
183+ For historical reasons, union (` + ` ) takes precedence over intersection (` & ` ) and exclusion (` - ` ), which can lead to unexpected results.
184+ For example, ` a + b & c ` is evaluated as ` (a + b) & c ` , not ` a + (b & c) ` .
185+
186+ We intend to add a flag to fix this precedence issue in the future.
187+
188+ It is highly recommended to either:
189+
190+ - Break complex expressions into intermediate permissions:
191+
192+ ``` zed
193+ permission writers_and_admins = writer & admin
194+ permission view = reader + writers_and_admins
195+ ```
196+
197+ - Use explicit parentheses to clarify precedence:
198+
199+ ``` zed
200+ permission view = reader + (writer & admin)
201+ ```
202+
203+ </Callout >
204+
180205Permissions support four kinds of operations: ** union** , ** intersection** , ** exclusion** and ** arrow** .
181206
182207#### ` + ` (Union)
You can’t perform that action at this time.
0 commit comments