Make a hierarchy in roles

This is more understandable for users.
This commit is contained in:
2017-04-19 21:24:35 +02:00
parent b6d1f05e00
commit 0e5ab47474
7 changed files with 190 additions and 33 deletions

View File

@@ -15,6 +15,10 @@
<h2>{{ 'Grant those permissions'|trans }} :</h2>
{%- if entity.getRoleScopes|length > 0 -%}
{% for title, role_scopes in role_scopes_sorted %}
<h3>{{ title|default("Unclassified")|trans }}</h3>
<table class="striped rounded">
<thead>
<tr>
@@ -25,7 +29,7 @@
</thead>
<tbody>
{% for role_scope in entity.getRoleScopes %}
{% for role_scope in role_scopes %}
<tr>
<td>
<span class="role_scope role">{{ role_scope.role|trans }}</span>
@@ -53,6 +57,7 @@
{% endfor %}
</tbody>
</table>
{% endfor %}
{%- else -%}
<p>{{ 'This group does not provide any permission'|trans }}</p>
@@ -64,15 +69,24 @@
{{ form_errors(add_role_scopes_form) }}
{{ form_row(add_role_scopes_form.composed_role_scope.role) }}
{{ form_row(add_role_scopes_form.composed_role_scope.scope) }}
{{ form_row(add_role_scopes_form.submit, { 'attr' : { 'class': 'sc-button green' } } ) }}
<ul class="record_actions">
<li>
{{ form_row(add_role_scopes_form.submit, { 'attr' : { 'class': 'sc-button bt-create' } } ) }}
</li>
<li>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="sc-button bt-see">{{ 'Cancel'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{{ form_end(add_role_scopes_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -17,12 +17,12 @@
<tr>
<td><a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}">{{ entity.name }}</a></td>
<td>
<ul>
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}">{{ 'show'|trans }}</a>
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="sc-button bt-see">{{ 'See'|trans }}</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}">{{ 'edit'|trans }}</a>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">{{ 'Edit'|trans }}</a>
</li>
</ul>
</td>
@@ -31,9 +31,9 @@
</tbody>
</table>
<ul>
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup_new') }}">
<a href="{{ path('admin_permissionsgroup_new') }}" class="sc-button bt-create">
{{ 'Create a new permissions group'| trans }}
</a>
</li>

View File

@@ -13,9 +13,11 @@
</tr>
</tbody>
</table>
{% if role_scopes|length > 0 %}
{% if role_scopes_sorted|length > 0 %}
<h2>{{ 'Grant those permissions'|trans }}&nbsp;:</h2>
{% for title, role_scopes in role_scopes_sorted %}
<h3>{{ title|default('Unclassified')|trans }}</h3>
<table class="striped rounded">
<thead>
<tr>
@@ -24,6 +26,7 @@
</tr>
</thead>
<tbody>
{% for role_scope in role_scopes %}
<tr>
<td>
@@ -43,6 +46,7 @@
{% endfor %}
</tbody>
</table>
{% endfor %}
{% else %}
@@ -51,16 +55,18 @@
{{ 'add permissions'|trans|capitalize }}</a></p>
{% endif %}
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup') }}">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
{{ 'Edit'|trans }}
</a>
</li>
<li>
<a href="{{ path('admin_permissionsgroup') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>
{% endblock %}