mirror of https://github.com/jumpserver/jumpserver
perf: 优化 acl 迁移中的 accounts
parent
1b750cf51d
commit
0d3478c728
|
@ -25,10 +25,9 @@ def migrate_base_acl_users_assets_accounts(apps, *args):
|
||||||
obj.new_assets = {"type": "attrs", "attrs": asset_attrs}
|
obj.new_assets = {"type": "attrs", "attrs": asset_attrs}
|
||||||
|
|
||||||
account_usernames = (obj.accounts or {}).get('username_group', [])
|
account_usernames = (obj.accounts or {}).get('username_group', [])
|
||||||
obj.new_accounts = {
|
if '*' in account_usernames:
|
||||||
"type": "attrs",
|
account_usernames = ['@ALL']
|
||||||
"attrs": [{"name": "username", "value": account_usernames, "match": "in"}]
|
obj.new_accounts = account_usernames
|
||||||
}
|
|
||||||
obj.save()
|
obj.save()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue