diff --git a/canaille/templates/profile.html b/canaille/templates/profile.html
index bdb1b444..f2b39b12 100644
--- a/canaille/templates/profile.html
+++ b/canaille/templates/profile.html
@@ -5,6 +5,18 @@
{% endblock %}
+{% macro render_field(field, noindicator=false) %}
+ {% if edited_user.uid == user.uid or noindicator %}
+ {{ sui.render_field(field) }}
+ {% elif field.name in edited_user.write %}
+ {{ sui.render_field(field, noindicator=true) }}
+ {% elif field.name in edited_user.read %}
+ {{ sui.render_field(field, indicator_icon="eye", indicator_text=_("This user cannot edit this field")) }}
+ {% else %}
+ {{ sui.render_field(field, indicator_icon="eye slash", indicator_text=_("This user cannot see this field")) }}
+ {% endif %}
+{% endmacro %}
+
{% block content %}
{% if self_deletion or (user.can_manage_users and edited_user) %}
@@ -59,39 +71,39 @@
class="ui form info{% if user.can_manage_users and edited_user and not edited_user.has_password() %} warning{% endif %}"
>
- {#{ sui.render_field(form.csrf_token) }#}
+ {#{ render_field(form.csrf_token) }#}
{% if "givenName" in form %}
- {{ sui.render_field(form.givenName) }}
+ {{ render_field(form.givenName) }}
{% endif %}
{% if "sn" in form %}
- {{ sui.render_field(form.sn) }}
+ {{ render_field(form.sn) }}
{% endif %}
{% if "mail" in form %}
- {{ sui.render_field(form.mail) }}
+ {{ render_field(form.mail) }}
{% endif %}
{% if "telephoneNumber" in form %}
- {{ sui.render_field(form.telephoneNumber) }}
+ {{ render_field(form.telephoneNumber) }}
{% endif %}
{% if "employeeNumber" in form %}
- {{ sui.render_field(form.employeeNumber) }}
+ {{ render_field(form.employeeNumber) }}
{% endif %}
{% if "groups" in form %}
- {{ sui.render_field(form.groups) }}
+ {{ render_field(form.groups) }}
{% endif %}
{% if "uid" in form %}
- {{ sui.render_field(form.uid) }}
+ {{ render_field(form.uid) }}
{% endif %}
{% if "password1" in form %}
- {{ sui.render_field(form.password1) }}
- {{ sui.render_field(form.password2) }}
+ {{ render_field(form.password1, noindicator=true) }}
+ {{ render_field(form.password2, noindicator=true) }}
{% endif %}
diff --git a/canaille/translations/fr/LC_MESSAGES/messages.mo b/canaille/translations/fr/LC_MESSAGES/messages.mo
index bb05b76f..b3c4a70f 100644
Binary files a/canaille/translations/fr/LC_MESSAGES/messages.mo and b/canaille/translations/fr/LC_MESSAGES/messages.mo differ
diff --git a/canaille/translations/fr/LC_MESSAGES/messages.po b/canaille/translations/fr/LC_MESSAGES/messages.po
index 46f6bb4b..ba38ce4f 100644
--- a/canaille/translations/fr/LC_MESSAGES/messages.po
+++ b/canaille/translations/fr/LC_MESSAGES/messages.po
@@ -9,8 +9,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: contact@yaal.fr\n"
-"POT-Creation-Date: 2021-12-05 18:47+0100\n"
-"PO-Revision-Date: 2021-12-05 18:47+0100\n"
+"POT-Creation-Date: 2021-12-05 19:40+0100\n"
+"PO-Revision-Date: 2021-12-05 19:41+0100\n"
"Last-Translator: Éloi Rivard
\n"
"Language: fr_FR\n"
"Language-Team: French - France \n"
@@ -515,11 +515,11 @@ msgstr "Page de connexion"
msgid "Send the initialization email"
msgstr "Envoyer le courriel d'initialisation"
-#: canaille/templates/fomanticui.html:33
+#: canaille/templates/fomanticui.html:38 canaille/templates/fomanticui.html:42
msgid "This field is not editable"
msgstr "Ce champ n'est pas modifiable"
-#: canaille/templates/fomanticui.html:37
+#: canaille/templates/fomanticui.html:46
msgid "This field is required"
msgstr "Ce champ est requis"
@@ -546,7 +546,7 @@ msgstr ""
" "
#: canaille/templates/forgotten-password.html:38
-#: canaille/templates/profile.html:119 canaille/templates/profile.html:142
+#: canaille/templates/profile.html:133 canaille/templates/profile.html:156
msgid "Send again"
msgstr "Envoyer à nouveau"
@@ -567,12 +567,12 @@ msgstr ""
"irrévocable, et toutes les données de cet utilisateur seront supprimées."
#: canaille/templates/admin/client_edit.html:18
-#: canaille/templates/group.html:29 canaille/templates/profile.html:25
+#: canaille/templates/group.html:29 canaille/templates/profile.html:37
msgid "Cancel"
msgstr "Annuler"
#: canaille/templates/admin/client_edit.html:19
-#: canaille/templates/group.html:30 canaille/templates/profile.html:26
+#: canaille/templates/group.html:30 canaille/templates/profile.html:38
msgid "Delete"
msgstr "Supprimer"
@@ -610,7 +610,7 @@ msgstr "Supprimer le groupe"
msgid "Create group"
msgstr "Créer le groupe"
-#: canaille/templates/group.html:79 canaille/templates/profile.html:182
+#: canaille/templates/group.html:79 canaille/templates/profile.html:196
msgid "Submit"
msgstr "Valider"
@@ -703,11 +703,23 @@ msgstr "Je ne suis pas %(username)s"
msgid "Sign in"
msgstr "Se connecter"
-#: canaille/templates/profile.html:13
+#: canaille/templates/profile.html:12
+msgid "This user can edit this field"
+msgstr "Cet utilisateur peut éditer ce champ"
+
+#: canaille/templates/profile.html:14
+msgid "This user cannot edit this field"
+msgstr "Cet utilisateur ne peut pas éditer ce champ"
+
+#: canaille/templates/profile.html:16
+msgid "This user cannot see this field"
+msgstr "Cet utilisateur ne peut pas voir ce champ"
+
+#: canaille/templates/profile.html:25
msgid "Account deletion"
msgstr "Suppression d'un compte"
-#: canaille/templates/profile.html:18
+#: canaille/templates/profile.html:30
msgid ""
"Are you sure you want to delete this user? This action is unrevokable and "
"all the data about this user will be removed."
@@ -715,7 +727,7 @@ msgstr ""
"Êtes-vous sûrs de vouloir supprimer cet utilisateur ? Cette action est "
"irrévocable, et toutes les données de cet utilisateur seront supprimées."
-#: canaille/templates/profile.html:20
+#: canaille/templates/profile.html:32
msgid ""
"Are you sure you want to delete your account? This action is unrevokable and "
"all your data will be removed forever."
@@ -723,51 +735,51 @@ msgstr ""
"Êtes-vous sûrs de vouloir supprimer votre compte ? Cette action est "
"irrévocable et toutes vos données seront supprimées pour toujours."
-#: canaille/templates/profile.html:35
+#: canaille/templates/profile.html:47
msgid "User creation"
msgstr "Nouvel utilisateur"
-#: canaille/templates/profile.html:37 canaille/themes/default/base.html:39
+#: canaille/templates/profile.html:49 canaille/themes/default/base.html:39
msgid "My profile"
msgstr "Mon profil"
-#: canaille/templates/profile.html:39
+#: canaille/templates/profile.html:51
msgid "User profile edition"
msgstr "Édition d'un profil utilisateur"
-#: canaille/templates/profile.html:45
+#: canaille/templates/profile.html:57
msgid "Create a new user account"
msgstr "Création d'un nouveau compte utilisateur"
-#: canaille/templates/profile.html:47
+#: canaille/templates/profile.html:59
msgid "Edit your personal informations"
msgstr "Éditez vos informations personnelles"
-#: canaille/templates/profile.html:49
+#: canaille/templates/profile.html:61
msgid "Edit informations about an user"
msgstr "Éditez les informations d'un utilisateur"
-#: canaille/templates/profile.html:64
+#: canaille/templates/profile.html:78
msgid "Personal information"
msgstr "Informations personnelles"
-#: canaille/templates/profile.html:86
+#: canaille/templates/profile.html:100
msgid "Account information"
msgstr "Informations sur le compte"
-#: canaille/templates/profile.html:104
+#: canaille/templates/profile.html:118
msgid "User password is not mandatory"
msgstr "Le mot de passe utilisateur n'est pas requis à la création"
-#: canaille/templates/profile.html:106
+#: canaille/templates/profile.html:120
msgid "The user password can be set:"
msgstr "Il pourra être renseigné :"
-#: canaille/templates/profile.html:108
+#: canaille/templates/profile.html:122
msgid "by filling this form;"
msgstr "en remplissant ce formulaire ;"
-#: canaille/templates/profile.html:109
+#: canaille/templates/profile.html:123
msgid ""
"by sending the user a password initialization mail, after the account "
"creation;"
@@ -775,7 +787,7 @@ msgstr ""
"en envoyant un lien d'initialisation de mot de passe, par mail à "
"l'utilisateur, après la création de son compte;"
-#: canaille/templates/profile.html:110 canaille/templates/profile.html:133
+#: canaille/templates/profile.html:124 canaille/templates/profile.html:147
msgid ""
"or simply waiting for the user to sign-in a first time, and then receive a "
"password initialization mail."
@@ -783,40 +795,40 @@ msgstr ""
"ou simplement en attendant la première connexion de l'utilisateur, afin "
"qu'il reçoive un lien d'initialisation de mot de passe par email."
-#: canaille/templates/profile.html:123
+#: canaille/templates/profile.html:137
msgid "Send email"
msgstr "Envoyer l'email"
-#: canaille/templates/profile.html:127
+#: canaille/templates/profile.html:141
msgid "This user does not have a password yet"
msgstr "L'utilisateur n'a pas encore de mot de passe"
-#: canaille/templates/profile.html:129
+#: canaille/templates/profile.html:143
msgid "You can solve this by:"
msgstr "Vous pouvez régler ceci en :"
-#: canaille/templates/profile.html:131
+#: canaille/templates/profile.html:145
msgid "setting a password using this form;"
msgstr "renseignant un mot de passe via ce formulaire ;"
-#: canaille/templates/profile.html:132
+#: canaille/templates/profile.html:146
msgid ""
"sending the user a password initialization mail, by clicking this button;"
msgstr ""
"envoyant un lien d'initialisation de mot de passe, par mail à l'utilisateur, "
"en cliquant sur ce bouton;"
-#: canaille/templates/profile.html:144
+#: canaille/templates/profile.html:158
msgid "Send mail"
msgstr "Envoyer l'email"
-#: canaille/templates/admin/mails.html:34 canaille/templates/profile.html:148
+#: canaille/templates/admin/mails.html:34 canaille/templates/profile.html:162
#: canaille/templates/reset-password.html:11
#: canaille/templates/reset-password.html:16
msgid "Password reset"
msgstr "Réinitialisation du mot de passe"
-#: canaille/templates/profile.html:150
+#: canaille/templates/profile.html:164
msgid ""
"If the user has forgotten his password, you can send him a password reset "
"email by clicking this button."
@@ -824,19 +836,19 @@ msgstr ""
"Si l'utilisateur a oublié son mot de passe, vous pouvez lui envoyer un email "
"contenant un lien de réinitilisation en cliquant sur ce bouton."
-#: canaille/templates/profile.html:162
+#: canaille/templates/profile.html:176
msgid "Delete the user"
msgstr "Supprimer l'utilisateur"
-#: canaille/templates/profile.html:164
+#: canaille/templates/profile.html:178
msgid "Delete my account"
msgstr "Supprimer mon compte"
-#: canaille/templates/profile.html:171
+#: canaille/templates/profile.html:185
msgid "Impersonate"
msgstr "Prendre l'identité"
-#: canaille/templates/profile.html:177 canaille/templates/users.html:18
+#: canaille/templates/profile.html:191 canaille/templates/users.html:18
msgid "Invite a user"
msgstr "Inviter un utilisateur"
diff --git a/canaille/translations/messages.pot b/canaille/translations/messages.pot
index 792e1d9e..5437ab39 100644
--- a/canaille/translations/messages.pot
+++ b/canaille/translations/messages.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2021-12-05 18:47+0100\n"
+"POT-Creation-Date: 2021-12-05 19:40+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -493,11 +493,11 @@ msgstr ""
msgid "Send the initialization email"
msgstr ""
-#: canaille/templates/fomanticui.html:33
+#: canaille/templates/fomanticui.html:38 canaille/templates/fomanticui.html:42
msgid "This field is not editable"
msgstr ""
-#: canaille/templates/fomanticui.html:37
+#: canaille/templates/fomanticui.html:46
msgid "This field is required"
msgstr ""
@@ -518,7 +518,7 @@ msgid ""
msgstr ""
#: canaille/templates/forgotten-password.html:38
-#: canaille/templates/profile.html:119 canaille/templates/profile.html:142
+#: canaille/templates/profile.html:133 canaille/templates/profile.html:156
msgid "Send again"
msgstr ""
@@ -537,12 +537,12 @@ msgid ""
msgstr ""
#: canaille/templates/admin/client_edit.html:18
-#: canaille/templates/group.html:29 canaille/templates/profile.html:25
+#: canaille/templates/group.html:29 canaille/templates/profile.html:37
msgid "Cancel"
msgstr ""
#: canaille/templates/admin/client_edit.html:19
-#: canaille/templates/group.html:30 canaille/templates/profile.html:26
+#: canaille/templates/group.html:30 canaille/templates/profile.html:38
msgid "Delete"
msgstr ""
@@ -577,7 +577,7 @@ msgstr ""
msgid "Create group"
msgstr ""
-#: canaille/templates/group.html:79 canaille/templates/profile.html:182
+#: canaille/templates/group.html:79 canaille/templates/profile.html:196
msgid "Submit"
msgstr ""
@@ -664,127 +664,139 @@ msgstr ""
msgid "Sign in"
msgstr ""
-#: canaille/templates/profile.html:13
+#: canaille/templates/profile.html:12
+msgid "This user can edit this field"
+msgstr ""
+
+#: canaille/templates/profile.html:14
+msgid "This user cannot edit this field"
+msgstr ""
+
+#: canaille/templates/profile.html:16
+msgid "This user cannot see this field"
+msgstr ""
+
+#: canaille/templates/profile.html:25
msgid "Account deletion"
msgstr ""
-#: canaille/templates/profile.html:18
+#: canaille/templates/profile.html:30
msgid ""
"Are you sure you want to delete this user? This action is unrevokable and"
" all the data about this user will be removed."
msgstr ""
-#: canaille/templates/profile.html:20
+#: canaille/templates/profile.html:32
msgid ""
"Are you sure you want to delete your account? This action is unrevokable "
"and all your data will be removed forever."
msgstr ""
-#: canaille/templates/profile.html:35
+#: canaille/templates/profile.html:47
msgid "User creation"
msgstr ""
-#: canaille/templates/profile.html:37 canaille/themes/default/base.html:39
+#: canaille/templates/profile.html:49 canaille/themes/default/base.html:39
msgid "My profile"
msgstr ""
-#: canaille/templates/profile.html:39
+#: canaille/templates/profile.html:51
msgid "User profile edition"
msgstr ""
-#: canaille/templates/profile.html:45
+#: canaille/templates/profile.html:57
msgid "Create a new user account"
msgstr ""
-#: canaille/templates/profile.html:47
+#: canaille/templates/profile.html:59
msgid "Edit your personal informations"
msgstr ""
-#: canaille/templates/profile.html:49
+#: canaille/templates/profile.html:61
msgid "Edit informations about an user"
msgstr ""
-#: canaille/templates/profile.html:64
+#: canaille/templates/profile.html:78
msgid "Personal information"
msgstr ""
-#: canaille/templates/profile.html:86
+#: canaille/templates/profile.html:100
msgid "Account information"
msgstr ""
-#: canaille/templates/profile.html:104
+#: canaille/templates/profile.html:118
msgid "User password is not mandatory"
msgstr ""
-#: canaille/templates/profile.html:106
+#: canaille/templates/profile.html:120
msgid "The user password can be set:"
msgstr ""
-#: canaille/templates/profile.html:108
+#: canaille/templates/profile.html:122
msgid "by filling this form;"
msgstr ""
-#: canaille/templates/profile.html:109
+#: canaille/templates/profile.html:123
msgid ""
"by sending the user a password initialization mail, after the account "
"creation;"
msgstr ""
-#: canaille/templates/profile.html:110 canaille/templates/profile.html:133
+#: canaille/templates/profile.html:124 canaille/templates/profile.html:147
msgid ""
"or simply waiting for the user to sign-in a first time, and then receive "
"a password initialization mail."
msgstr ""
-#: canaille/templates/profile.html:123
+#: canaille/templates/profile.html:137
msgid "Send email"
msgstr ""
-#: canaille/templates/profile.html:127
+#: canaille/templates/profile.html:141
msgid "This user does not have a password yet"
msgstr ""
-#: canaille/templates/profile.html:129
+#: canaille/templates/profile.html:143
msgid "You can solve this by:"
msgstr ""
-#: canaille/templates/profile.html:131
+#: canaille/templates/profile.html:145
msgid "setting a password using this form;"
msgstr ""
-#: canaille/templates/profile.html:132
+#: canaille/templates/profile.html:146
msgid "sending the user a password initialization mail, by clicking this button;"
msgstr ""
-#: canaille/templates/profile.html:144
+#: canaille/templates/profile.html:158
msgid "Send mail"
msgstr ""
-#: canaille/templates/admin/mails.html:34 canaille/templates/profile.html:148
+#: canaille/templates/admin/mails.html:34 canaille/templates/profile.html:162
#: canaille/templates/reset-password.html:11
#: canaille/templates/reset-password.html:16
msgid "Password reset"
msgstr ""
-#: canaille/templates/profile.html:150
+#: canaille/templates/profile.html:164
msgid ""
"If the user has forgotten his password, you can send him a password reset"
" email by clicking this button."
msgstr ""
-#: canaille/templates/profile.html:162
+#: canaille/templates/profile.html:176
msgid "Delete the user"
msgstr ""
-#: canaille/templates/profile.html:164
+#: canaille/templates/profile.html:178
msgid "Delete my account"
msgstr ""
-#: canaille/templates/profile.html:171
+#: canaille/templates/profile.html:185
msgid "Impersonate"
msgstr ""
-#: canaille/templates/profile.html:177 canaille/templates/users.html:18
+#: canaille/templates/profile.html:191 canaille/templates/users.html:18
msgid "Invite a user"
msgstr ""