{% extends 'base.html.twig' %} {% import "macros/datatables.html.twig" as tables %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/toolbar.html.twig" as toolbar %} {% import "permission/actions.html.twig" as actions %} {% set columns = { 'label.name': 'alwaysVisible', } %} {% set canEditPermissions = is_granted('role_permissions') %} {% for role in roles %} {% set options = {'class': 'alwaysVisible text-center'} %} {% if canEditPermissions and role.name not in system_roles|keys %} {% set widget %} {{ widgets.icon('trash') }} {% endset %} {% set options = options|merge({'html_after': widget}) %} {% endif %} {% set columns = columns|merge({ (role.name|trans): options, }) %} {% endfor %} {% set tableName = 'user_admin_permissions' %} {% block page_title %}{{ 'profile.roles'|trans }}{% endblock %} {% block page_actions %}{{ actions.user_permissions('index') }}{% endblock %} {% block main %} {{ tables.datatable_header(tableName, columns, null, {'translationPrefix': ''}) }} {% set colspan = 1 + (roles|length) %} {% for title, perms in sorted %} {% if perms|length > 0 %}