mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2025-02-17 04:57:57 +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 = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='adherent',
|
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(
|
migrations.AlterModelOptions(
|
||||||
name='ban',
|
name='ban',
|
||||||
|
@ -26,7 +26,7 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='club',
|
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(
|
migrations.AlterModelOptions(
|
||||||
name='emailaddress',
|
name='emailaddress',
|
||||||
|
|
|
@ -1027,21 +1027,7 @@ class Adherent(User):
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta(User.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")),
|
|
||||||
)
|
|
||||||
verbose_name = _("member")
|
verbose_name = _("member")
|
||||||
verbose_name_plural = _("members")
|
verbose_name_plural = _("members")
|
||||||
|
|
||||||
|
@ -1100,21 +1086,7 @@ class Club(User):
|
||||||
default=False
|
default=False
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta(User.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")),
|
|
||||||
)
|
|
||||||
verbose_name = _("club")
|
verbose_name = _("club")
|
||||||
verbose_name_plural = _("clubs")
|
verbose_name_plural = _("clubs")
|
||||||
|
|
||||||
|
@ -1847,7 +1819,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
|
||||||
if self.local_part == self.user.pseudo.lower():
|
if self.local_part == self.user.pseudo.lower():
|
||||||
return False, _("You can't delete a local email account whose"
|
return False, _("You can't delete a local email account whose"
|
||||||
" local part is the same as the username.")
|
" 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
|
return True, None
|
||||||
if not OptionalUser.get_cached_value('local_email_accounts_enabled'):
|
if not OptionalUser.get_cached_value('local_email_accounts_enabled'):
|
||||||
return False, _("The local email accounts are not enabled.")
|
return False, _("The local email accounts are not enabled.")
|
||||||
|
|
Loading…
Add table
Reference in a new issue