From 55a63477ed99695be37ebbf6cc4280557a93fb4b Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Thu, 17 Mar 2022 14:36:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B5=84=E4=BA=A7=E7=9B=B8=E5=85=B3=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/migrations/0089_auto_20220310_0616.py | 2 +- apps/assets/models/user.py | 3 --- utils/clean_db_content_types.py | 3 +++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/assets/migrations/0089_auto_20220310_0616.py b/apps/assets/migrations/0089_auto_20220310_0616.py index 342c3d887..1aa70d616 100644 --- a/apps/assets/migrations/0089_auto_20220310_0616.py +++ b/apps/assets/migrations/0089_auto_20220310_0616.py @@ -16,7 +16,7 @@ class Migration(migrations.Migration): ), migrations.AlterModelOptions( name='systemuser', - options={'ordering': ['name'], 'permissions': [('view_systemuserasset', 'Can view system user asset'), ('add_systemuserasset', 'Can add asset to system user'), ('remove_systemuserasset', 'Can remove system user asset'), ('match_systemuser', 'Can match system user')], 'verbose_name': 'System user'}, + options={'ordering': ['name'], 'permissions': [('match_systemuser', 'Can match system user')], 'verbose_name': 'System user'}, ), migrations.AlterModelOptions( name='asset', diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index 6ae0fa825..678e5f8cf 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -324,9 +324,6 @@ class SystemUser(ProtocolMixin, AuthMixin, BaseUser): unique_together = [('name', 'org_id')] verbose_name = _("System user") permissions = [ - ('view_systemuserasset', _('Can view system user asset')), - ('add_systemuserasset', _('Can add asset to system user')), - ('remove_systemuserasset', _('Can remove system user asset')), ('match_systemuser', _('Can match system user')), ] diff --git a/utils/clean_db_content_types.py b/utils/clean_db_content_types.py index d8c05db22..82c9f138c 100644 --- a/utils/clean_db_content_types.py +++ b/utils/clean_db_content_types.py @@ -79,6 +79,9 @@ def clean_db_content_types(): ('rbac', 'menupermission', 'view_userview'), ('rbac', 'menupermission', 'view_adminview'), ('rbac', 'menupermission', 'view_auditview'), + ('assets', 'systemuser', 'view_systemuserasset'), + ('assets', 'systemuser', 'add_systemuserasset'), + ('assets', 'systemuser', 'remove_systemuserasset'), ] for app, model, codename in permissions_delete_required: print('delete {}.{} ({})'.format(app, codename, model))