mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 11:53:12 +00:00
Pas de redondance dans les droits hérités sur Club et Adherent
This commit is contained in:
parent
f6130c2335
commit
6f1ccaf306
2 changed files with 5 additions and 33 deletions
|
@ -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',
|
||||
|
|
|
@ -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.")
|
||||
|
|
Loading…
Reference in a new issue