diff --git a/apps/accounts/migrations/0003_automation.py b/apps/accounts/migrations/0003_automation.py index 12747a4ab..98f5f01f2 100644 --- a/apps/accounts/migrations/0003_automation.py +++ b/apps/accounts/migrations/0003_automation.py @@ -38,7 +38,7 @@ class Migration(migrations.Migration): 'verbose_name': 'Automation execution', 'verbose_name_plural': 'Automation executions', 'permissions': [('view_changesecretexecution', 'Can view change secret execution'), - ('add_changesecretexection', 'Can add change secret execution'), + ('add_changesecretexecution', 'Can add change secret execution'), ('view_gatheraccountsexecution', 'Can view gather accounts execution'), ('add_gatheraccountsexecution', 'Can add gather accounts execution')], 'proxy': True, @@ -184,7 +184,7 @@ class Migration(migrations.Migration): migrations.AlterModelOptions( name='automationexecution', options={'permissions': [('view_changesecretexecution', 'Can view change secret execution'), - ('add_changesecretexection', 'Can add change secret execution'), + ('add_changesecretexecution', 'Can add change secret execution'), ('view_gatheraccountsexecution', 'Can view gather accounts execution'), ('add_gatheraccountsexecution', 'Can add gather accounts execution'), ('view_pushaccountexecution', 'Can view push account execution'), diff --git a/apps/accounts/models/automations/base.py b/apps/accounts/models/automations/base.py index 79f17614f..1adc84bfe 100644 --- a/apps/accounts/models/automations/base.py +++ b/apps/accounts/models/automations/base.py @@ -33,7 +33,7 @@ class AutomationExecution(AssetAutomationExecution): verbose_name_plural = _("Automation executions") permissions = [ ('view_changesecretexecution', _('Can view change secret execution')), - ('add_changesecretexection', _('Can add change secret execution')), + ('add_changesecretexecution', _('Can add change secret execution')), ('view_gatheraccountsexecution', _('Can view gather accounts execution')), ('add_gatheraccountsexecution', _('Can add gather accounts execution')), diff --git a/apps/rbac/migrations/0012_remove_add_changesecretexection_permission.py b/apps/rbac/migrations/0012_remove_add_changesecretexection_permission.py new file mode 100644 index 000000000..a402360dc --- /dev/null +++ b/apps/rbac/migrations/0012_remove_add_changesecretexection_permission.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.10 on 2023-10-20 07:01 + +from django.db import migrations + + +def migrate_remove_add_changesecretexection_permission(apps, *args): + perm_model = apps.get_model('auth', 'Permission') + perm_model.objects.filter(codename='add_changesecretexection').delete() + + +class Migration(migrations.Migration): + dependencies = [ + ('rbac', '0011_remove_redundant_permission'), + ] + + operations = [ + migrations.RunPython(migrate_remove_add_changesecretexection_permission) + ] diff --git a/apps/rbac/tree.py b/apps/rbac/tree.py index ef1571a1f..377fbbe59 100644 --- a/apps/rbac/tree.py +++ b/apps/rbac/tree.py @@ -88,7 +88,7 @@ special_pid_mapper = { "accounts.add_gatheraccountsexecution": "gather_account_node", "accounts.changesecretautomation": "asset_change_plan_node", "accounts.view_changesecretexecution": "asset_change_plan_node", - "accounts.add_changesecretexection": "asset_change_plan_node", + "accounts.add_changesecretexecution": "asset_change_plan_node", "accounts.view_changesecretrecord": "asset_change_plan_node", 'orgs.organization': 'view_setting', 'settings.setting': 'view_setting',