fix: 去除系统用户资产相关权限

pull/7905/head
Jiangjie.Bai 2022-03-17 14:36:38 +08:00 committed by Jiangjie.Bai
parent 5942037d81
commit 55a63477ed
3 changed files with 4 additions and 4 deletions

View File

@ -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',

View File

@ -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')),
]

View File

@ -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))