docs: add note on using array session variables in permission builder (close #5578) (#5595)

https://github.com/hasura/graphql-engine/pull/5595
This commit is contained in:
AlbertGao 2020-10-02 01:34:43 +13:00 committed by GitHub
parent 2579f122e6
commit 09d0d58436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -151,6 +151,15 @@ the author's ID*):
.. thumbnail:: /img/graphql/core/auth/session-variables-in-permissions-simple-example.png
:alt: Using session variables to build rules
.. admonition:: Array session variables in permission rules
Support for using session variables for array operators like ``_in``, ``_nin``, ``_has_any_keys``,
``_has_all_keys`` is available in versions ``v.1.0.0-beta.3`` and above.
When you use array operators such as ``_in`` in the permissions builder in the Hasura console, it will automatically open 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.
.. _relationships-in-permissions:
Using relationships or nested objects

View File

@ -221,10 +221,14 @@ The permission for ``org-member`` role changes to this:
]
}
.. admonition:: Arrays in permission rules
.. admonition:: Array session variables in permission rules
Support for using session variables for array operators like ``_in``, ``_nin``, ``_has_any_keys``,
``_has_all_keys`` is only added in ``beta.3`` release.
``_has_all_keys`` is available in versions ``v.1.0.0-beta.3`` and above.
When you use array operators such as ``_in`` in the permissions builder in the Hasura console, it will automatically open 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.
Format of session variables
---------------------------