{# This file is part of the Sonata package. (c) Thomas Rabaix For the full copyright and license information, please view the LICENSE file that was distributed with this source code. #} {% trans_default_domain 'admin' %} {% block sonata_security_roles_widget %} {% spaceless %}
{% set object = form.vars.sonata_admin.admin.subject %}

{{ 'sonata.user.user.form.main-roles'|trans }}

{% set mainRoles = { 'ROLE_SUPER_ADMIN': 'sonata.user.user.role.ROLE_SUPER_ADMIN'|trans, 'ROLE_ADMIN': 'sonata.user.user.role.ROLE_ADMIN'|trans, 'ROLE_DIRECTMODERATION_ADD': 'sonata.user.user.role.ROLE_DIRECTMODERATION_ADD'|trans, 'ROLE_DIRECTMODERATION_EDIT_OWN_CONTRIB': 'sonata.user.user.role.ROLE_DIRECTMODERATION_EDIT_OWN_CONTRIB'|trans, 'ROLE_SONATA_ADMIN': 'sonata.user.user.role.ROLE_SONATA_ADMIN'|trans }%} {% for role, label in mainRoles %}
{% endfor %}

{{ 'sonata.user.user.fields.permissions_warning'|trans|raw }}

{{ 'sonata.user.user.fields.check_uncheck'|trans }}
{% for roles_group in choices|batch(5) %} {% set firstRole = roles_group|first %} {% if 'ROLE_ADMIN_' in firstRole.label or 'ROLE_SONATA_USER_ADMIN_' in firstRole.label %} {% set title = firstRole.label|split('ROLE_ADMIN_')|last|split('ROLE_SONATA_USER_ADMIN_')|last %} {% set title = title|replace({'_': ' '})|slice(0,-5) %} {% set hidden = 'HIDDEN' in title %} {% if title in ["GENERAL CONFIG", "ELEMENTS", "PROJECT"]%}
{% endif %} {% if not hidden %}
{% for role in roles_group %} {% set action = role.label|split('_')|last %}
{% endfor %}
{% endif %} {% endif %} {% endfor %}
{% endspaceless %} {% endblock sonata_security_roles_widget %}