From 26b3c60e5ce69b3d1f055867d4364f46cf6b884d Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Thu, 17 Mar 2022 16:01:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9Bperm?= =?UTF-8?q?s=E7=9B=B8=E5=85=B3=E7=9A=84=E6=9D=83=E9=99=90=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/migrations/0027_auto_20220310_1802.py | 4 ++-- apps/perms/models/application_permission.py | 1 - apps/perms/models/asset_permission.py | 2 -- utils/clean_db_content_types.py | 3 +++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/perms/migrations/0027_auto_20220310_1802.py b/apps/perms/migrations/0027_auto_20220310_1802.py index 542785345..48d9ffceb 100644 --- a/apps/perms/migrations/0027_auto_20220310_1802.py +++ b/apps/perms/migrations/0027_auto_20220310_1802.py @@ -27,10 +27,10 @@ class Migration(migrations.Migration): ), migrations.AlterModelOptions( name='applicationpermission', - options={'ordering': ('name',), 'permissions': [('view_permuserapplication', 'Can view application of permission to user')], 'verbose_name': 'Application permission'}, + options={'ordering': ('name',), 'permissions': [], 'verbose_name': 'Application permission'}, ), migrations.AlterModelOptions( name='assetpermission', - options={'ordering': ('name',), 'permissions': [('view_permuserasset', 'Can view asset of permission to user'), ('view_permusergroupasset', 'Can view asset of permission to user group')], 'verbose_name': 'Asset permission'}, + options={'ordering': ('name',), 'permissions': [], 'verbose_name': 'Asset permission'}, ), ] diff --git a/apps/perms/models/application_permission.py b/apps/perms/models/application_permission.py index 7cefec448..6bea6e47f 100644 --- a/apps/perms/models/application_permission.py +++ b/apps/perms/models/application_permission.py @@ -37,7 +37,6 @@ class ApplicationPermission(BasePermission): unique_together = [('org_id', 'name')] verbose_name = _('Application permission') permissions = [ - ('view_permuserapplication', _('Can view application of permission to user')) ] ordering = ('name',) diff --git a/apps/perms/models/asset_permission.py b/apps/perms/models/asset_permission.py index b8e4eddb5..ea795d889 100644 --- a/apps/perms/models/asset_permission.py +++ b/apps/perms/models/asset_permission.py @@ -29,8 +29,6 @@ class AssetPermission(BasePermission): verbose_name = _("Asset permission") ordering = ('name',) permissions = [ - ('view_permuserasset', _('Can view asset of permission to user')), - ('view_permusergroupasset', _('Can view asset of permission to user group')) ] @lazyproperty diff --git a/utils/clean_db_content_types.py b/utils/clean_db_content_types.py index 82c9f138c..9ca387be2 100644 --- a/utils/clean_db_content_types.py +++ b/utils/clean_db_content_types.py @@ -55,6 +55,9 @@ def clean_db_content_types(): ('perms', 'permedkubernetesapp', 'view_mykubernetesapp'), ('perms', 'permedremoteapp', 'connect_myremoteapp'), ('perms', 'permedremoteapp', 'view_myremoteapp'), + ('perms', 'applicationpermission', 'view_permuserapplication'), + ('perms', 'assetpermission', 'view_permuserasset'), + ('perms', 'assetpermission', 'view_permusergroupasset'), ('applications', 'databaseapp', 'add_databaseapp'), ('applications', 'databaseapp', 'change_databaseapp'),