mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-01 22:58:59 +00:00
Merge pull request #10695 from jumpserver/pr@dev@perf_acl_account_migrate
perf: 优化 acl 迁移中的 accounts
This commit is contained in:
commit
91ea738dcd
@ -25,10 +25,9 @@ def migrate_base_acl_users_assets_accounts(apps, *args):
|
||||
obj.new_assets = {"type": "attrs", "attrs": asset_attrs}
|
||||
|
||||
account_usernames = (obj.accounts or {}).get('username_group', [])
|
||||
obj.new_accounts = {
|
||||
"type": "attrs",
|
||||
"attrs": [{"name": "username", "value": account_usernames, "match": "in"}]
|
||||
}
|
||||
if '*' in account_usernames:
|
||||
account_usernames = ['@ALL']
|
||||
obj.new_accounts = account_usernames
|
||||
obj.save()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user