mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Added missing permission view_domainalias to DomainAdmins group
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 4.2.11 on 2024-03-20 10:37
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def set_missing_permission(apps, schema_editor):
|
||||
Permission = apps.get_model("auth", "Permission")
|
||||
Group = apps.get_model("auth", "Group")
|
||||
group = Group.objects.filter(name="DomainAdmins").first()
|
||||
if not group:
|
||||
# Fresh install, nothing to do
|
||||
return
|
||||
perm = Permission.objects.get(codename="view_domainalias")
|
||||
group.permissions.add(perm)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("admin", "0022_alter_alarm_domain"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(set_missing_permission, migrations.RunPython.noop),
|
||||
]
|
||||
@@ -78,6 +78,7 @@ PERMISSIONS = {
|
||||
["admin", "senderaddress", "add_senderaddress"],
|
||||
["admin", "senderaddress", "change_senderaddress"],
|
||||
["admin", "senderaddress", "delete_senderaddress"],
|
||||
["admin", "domainalias", "view_domainalias"],
|
||||
],
|
||||
"Resellers": [
|
||||
["core", "user", "add_user"],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"""A management command to load Modoboa initial data:
|
||||
"""
|
||||
A management command to load Modoboa initial data.
|
||||
|
||||
* Create a default super admin if none exists
|
||||
* Create groups and permissions
|
||||
|
||||
Reference in New Issue
Block a user