Edit on GitHub
Jump to docs navigation

Twig Components / Methods / is_granted

is_granted(role, object = null, field = null) is a Twig function to return true if the current user has the given role.

Optionally, an object can be passed to be used by the voter. More information can be found in Access Control in Templates.

{{ is_granted(role, object = null, field = null) }}

role
type: string

object (optional)
type: object

field (optional)
type: string

Source: Twig



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.