src/Sylius/Bundle/UiBundle/Resources/views/Grid/Action/link_with_roles.html.twig line 1

Open in your IDE?
  1. {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
  2. {% set hasRoles = false %}
  3. {%  if options.role in app.user.roles and (options.condition is not defined or options.condition) %}
  4.     {% if options.link.parameters.object is defined %}
  5.         {% if options.link.parameters.object and options.link.parameters.object.id %}
  6.             {% set path = options.link.parameters.object ? path(options.link.route, {'id': options.link.parameters.object.id}) : null %}
  7.         {% endif %}
  8.     {% else %}
  9.         {% set path = path(options.link.route, options.link.parameters|default({'id': data.id})) %}
  10.     {% endif %}
  11.     {% if path is defined %}
  12.         {{ buttons.default(path, options.link.label, options.link.id is defined? options.link.id : '', options.link.icon, options.link.class is defined ? options.link.class : '') }}
  13.     {% endif %}
  14. {% endif %}