Skip to content

Commit 8ba3229

Browse files
Jean85javiereguiluz
authored andcommitted
Improve is_granted documentation
1 parent c8094e2 commit 8ba3229

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

reference/twig_reference.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,19 @@ is_granted
302302
{{ is_granted(role, object = null, field = null) }}
303303
304304
``role``
305-
**type**: ``string``
305+
**type**: ``string``, ``string[]``
306306
``object`` *(optional)*
307307
**type**: ``object``
308308
``field`` *(optional)*
309309
**type**: ``string``
310310

311-
Returns ``true`` if the current user has the required role. Optionally,
312-
an object can be pasted to be used by the voter. More information can be
313-
found in :ref:`security-template`.
311+
Returns ``true`` if the current user has the required role, if only one
312+
is passed; if more than one is passed, with an array, the behavior depends
313+
on how the :ref:`Access Decision Manager <components-security-access-decision-manager>`
314+
is configured; by default, the user has to have at least one of the passed roles.
315+
316+
Optionally, an object can be pasted to be used by the voter. More information
317+
can be found in :ref:`security-template`.
314318

315319
.. note::
316320

0 commit comments

Comments
 (0)