{% extends 'layout.html' %} {% from 'macros.html' import common_styles %} {% block title %}Gestion des Rôles{% endblock %} {% block page_title %}Gestion des rôles{% endblock %} {% block styles %}{{ common_styles() }} {% endblock %} {% block content %}
Rôles & Permissions
{{ roles|length }} rôle(s) configuré(s)
Nouveau rôle
{% for r in roles %} {% else %} {% endfor %}
Rôle Description Utilisateurs Permissions Type Actions
{{ r.name }}
{{ r.description or '—' }} {{ r.user_count }} {% if r.name == 'SUPER ADMIN' %} {% set pct = 100 %} {% set granted = 23 %} {% else %} {% set total_p = 23 %} {% set granted_ns = namespace(n=0) %} {% for k in ['interventions','equipements','pieces','preventifs','ordres','fournisseurs','commandes','familles','operations','operateurs','qualifications','outillages','gammes','constats','rapports','utilisateurs','roles','activites','can_edit','can_add','can_delete','export_data','valider_demande'] %} {% if r[k] %}{% set granted_ns.n = granted_ns.n + 1 %}{% endif %} {% endfor %} {% set granted = granted_ns.n %} {% set pct = ((granted / total_p) * 100)|int %} {% endif %}
{{ granted }}/23 {{ pct }}%
{% if r.is_builtin %} Intégré {% else %} Personnalisé {% endif %}
{% if not r.is_builtin and r.name != 'SUPER ADMIN' %} {% endif %}

Aucun rôle trouvé dans la base de données.

Veuillez exécuter la migration pour charger les rôles par défaut.
{% endblock %} {% block scripts %} {% endblock %}