diff --git a/apps/rbac/const.py b/apps/rbac/const.py index b4e217977..b81ec1bf9 100644 --- a/apps/rbac/const.py +++ b/apps/rbac/const.py @@ -52,6 +52,8 @@ exclude_permissions = ( ('assets', 'verifyaccountautomation', '*', '*'), ('assets', 'changesecretrecord', 'add,delete,change', 'changesecretrecord'), ('assets', 'automationexecution', '*', 'automationexecution'), + ('assets', 'commandfilter', '*', '*'), + ('assets', 'commandfilterrule', '*', '*'), # TODO 暂时去掉历史账号的权限 ('assets', 'account', '*', 'assethistoryaccount'), ('assets', 'account', '*', 'assethistoryaccountsecret'), diff --git a/apps/rbac/migrations/0011_remove_redundant_permission.py b/apps/rbac/migrations/0011_remove_redundant_permission.py index 15cb8ef47..74d8412d4 100644 --- a/apps/rbac/migrations/0011_remove_redundant_permission.py +++ b/apps/rbac/migrations/0011_remove_redundant_permission.py @@ -7,12 +7,21 @@ def migrate_remove_redundant_permission(apps, *args): model = apps.get_model('rbac', 'ContentType') model.objects.filter(app_label='applications').delete() model.objects.filter(app_label='ops', model='task').delete() + model.objects.filter(app_label='xpack', model__in=[ 'applicationchangeauthplan', 'applicationchangeauthplanexecution', 'applicationchangeauthplantask', 'changeauthplan', 'changeauthplanexecution', 'changeauthplantask', 'gatherusertask', 'gatherusertaskexecution' ]).delete() + model.objects.filter(app_label='assets', model__in=[ + 'authbook', 'historicalauthbook' + ]).delete() + + model.objects.filter(app_label='perms', model__in=[ + 'applicationpermission', 'permedapplication', 'commandfilterrule', 'historicalauthbook' + ]).delete() + class Migration(migrations.Migration): dependencies = [