From 6f1ccaf3061c305a4802ba82a7fe72c50e9599f7 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Sun, 19 Aug 2018 17:26:11 +0200 Subject: [PATCH] =?UTF-8?q?Pas=20de=20redondance=20dans=20les=20droits=20h?= =?UTF-8?q?=C3=A9rit=C3=A9s=20sur=20Club=20et=20Adherent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/migrations/0076_auto_20180818_1321.py | 4 +-- users/models.py | 34 ++------------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/users/migrations/0076_auto_20180818_1321.py b/users/migrations/0076_auto_20180818_1321.py index 45fd1a62..95af1422 100644 --- a/users/migrations/0076_auto_20180818_1321.py +++ b/users/migrations/0076_auto_20180818_1321.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): operations = [ migrations.AlterModelOptions( name='adherent', - options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'member', 'verbose_name_plural': 'members'}, + options={'verbose_name': 'member', 'verbose_name_plural': 'members'}, ), migrations.AlterModelOptions( name='ban', @@ -26,7 +26,7 @@ class Migration(migrations.Migration): ), migrations.AlterModelOptions( name='club', - options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'club', 'verbose_name_plural': 'clubs'}, + options={'verbose_name': 'club', 'verbose_name_plural': 'clubs'}, ), migrations.AlterModelOptions( name='emailaddress', diff --git a/users/models.py b/users/models.py index b5874512..de342031 100755 --- a/users/models.py +++ b/users/models.py @@ -1027,21 +1027,7 @@ class Adherent(User): )] ) - class Meta: - permissions = ( - ("change_user_password", - _("Can change the password of a user")), - ("change_user_state", _("Can edit the state of a user")), - ("change_user_force", _("Can force the move")), - ("change_user_shell", _("Can edit the shell of a user")), - ("change_user_groups", - _("Can edit the groups of rights of a user (critical" - " permission)")), - ("change_all_users", - _("Can edit all users, including those with rights.")), - ("view_user", - _("Can view a user object")), - ) + class Meta(User.Meta): verbose_name = _("member") verbose_name_plural = _("members") @@ -1100,21 +1086,7 @@ class Club(User): default=False ) - class Meta: - permissions = ( - ("change_user_password", - _("Can change the password of a user")), - ("change_user_state", _("Can edit the state of a user")), - ("change_user_force", _("Can force the move")), - ("change_user_shell", _("Can edit the shell of a user")), - ("change_user_groups", - _("Can edit the groups of rights of a user (critical" - " permission)")), - ("change_all_users", - _("Can edit all users, including those with rights.")), - ("view_user", - _("Can view a user object")), - ) + class Meta(User.Meta): verbose_name = _("club") verbose_name_plural = _("clubs") @@ -1847,7 +1819,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model): if self.local_part == self.user.pseudo.lower(): return False, _("You can't delete a local email account whose" " local part is the same as the username.") - if user_request.has_perm('users.delete_emailaddress'): + if user_request.has_perm('users.delete_emailaddress'): return True, None if not OptionalUser.get_cached_value('local_email_accounts_enabled'): return False, _("The local email accounts are not enabled.")