Documents an example of array-based session variables

GITHUB_PR_NUMBER: 10125
GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/10125

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10673
Co-authored-by: Marco Pegoraro <427569+marcopeg@users.noreply.github.com>
Co-authored-by: Sean Park-Ross <94021366+seanparkross@users.noreply.github.com>
GitOrigin-RevId: 343c85e0de4f5f98a34777f81f9bc3c62a4e84cd
This commit is contained in:
hasura-bot 2024-02-21 01:54:17 +05:30
parent acd3f33bb5
commit 906482c0e7

View File

@ -296,6 +296,21 @@ When you use array operators such as `_in` in the permissions builder in the Has
an array for your values. If your session variable value is already an array, you can click the `[X-Hasura-Allowed-Ids]`
suggestion to remove the brackets and set your session variable in its place.
Here is an example of an array-based session variable:
```bash
X-Hasura-Allowed-Ids: {1,2,3}
```
And the related permission configuration:
```yaml
permission:
filter:
user_id:
_in: X-Hasura-Allowed-Ids
```
:::
## Permissions with relationships or nested objects {#relationships-in-permissions}