Doing a relayout of permissions to make it a bit easier to navigate
This commit is contained in:
1 parent
1549971a13
commit
eba7896893
5 files changed
+138
-24
No files matched your search
@@ -2,7 +2,32 @@
|
||||
<td>{{ r.id }}</td>
|
||||
<td>{{ r.name }}</td>
|
||||
<td>{{ r.description or "" }}</td>
|
||||
<td>{% for perm in r.permissions %}<span class="tag">{{ perm.name }}</span>{% endfor %}</td>
|
||||
<td>
|
||||
{% set role_perm_names = r.permissions | map(attribute='name') | list %}
|
||||
<table class="perm-matrix">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
{% for action in actions %}<th>{{ action }}</th>{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for scope in scopes %}
|
||||
<tr>
|
||||
<td class="perm-scope">{{ scope }}</td>
|
||||
{% for action in actions %}
|
||||
{% set key = scope ~ ':' ~ action %}
|
||||
{% if key in perm_map %}
|
||||
<td class="perm-cell">{{ '✓' if key in role_perm_names else '' }}</td>
|
||||
{% else %}
|
||||
<td class="perm-cell perm-na">—</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td class="row-actions">
|
||||
<button class="btn btn-ghost"
|
||||
hx-get="/admin/roles/{{ r.id }}/edit"
|
||||
|
||||
Reference in new issue
Block a user