Test a write against a list's rules
test_list_rulesA dry run of one write against a list's write rules (or candidate rules), using the list's live data: whether it would be allowed, which statement decided, and what every statement evaluated to. Nothing is written. Describe the write with itemId (the existing item, for update, delete and restore) and new, patch or merge. The token needs update on the list. 1 request, plus 1 per item the rules look up. To check syntax and the stored tests without live data, the JSONPad docs server's check_write_rules costs nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | No | The item's data after the write | |
| now | No | The time the rules see as now (ISO 8601) | |
| old | No | The item's data before the write, instead of itemId's | |
| list | Yes | The list: its id or pathName | |
| merge | No | A merge applied to the old data to make the new data, instead of new | |
| patch | No | A JSON Patch applied to the old data to make the new data, instead of new | |
| rules | No | Candidate rules to test instead of the saved ones | |
| action | Yes | What the write does | |
| itemId | No | The existing item (for update, delete and restore): its data and metadata are the old state | |
| pointer | No | For a write to part of the data: its JSON pointer | |
| identityId | No | Make the write as this identity |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stage | Yes | ||
| allowed | Yes |