Skip to content

Commit

Permalink
docs: add note on using array session variables in permission builder (
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert-Gao authored Oct 1, 2020
1 parent 2579f12 commit 09d0d58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/graphql/core/auth/authorization/permission-rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions docs/graphql/core/auth/authorization/roles-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------
Expand Down

0 comments on commit 09d0d58

Please sign in to comment.