mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-23 13:37:31 +00:00
perf: 修复可能导致的问题
This commit is contained in:
parent
cfca519158
commit
14efd9afc1
@ -60,25 +60,25 @@ class PermAccountUtil(AssetPermissionUtil):
|
|||||||
|
|
||||||
for alias, action_bit in alias_action_bit_mapper.items():
|
for alias, action_bit in alias_action_bit_mapper.items():
|
||||||
account = None
|
account = None
|
||||||
|
_accounts = []
|
||||||
if alias == AliasAccount.USER:
|
if alias == AliasAccount.USER:
|
||||||
if user.username in username_accounts_mapper:
|
if user.username in username_accounts_mapper:
|
||||||
account = username_accounts_mapper[user.username]
|
_accounts = username_accounts_mapper[user.username]
|
||||||
else:
|
else:
|
||||||
account = Account.get_user_account()
|
account = Account.get_user_account()
|
||||||
elif alias == AliasAccount.INPUT:
|
elif alias == AliasAccount.INPUT:
|
||||||
account = Account.get_manual_account()
|
account = Account.get_manual_account()
|
||||||
elif alias == AliasAccount.ANON:
|
elif alias == AliasAccount.ANON:
|
||||||
account = Account.get_anonymous_account()
|
account = Account.get_anonymous_account()
|
||||||
|
elif alias in username_accounts_mapper:
|
||||||
|
_accounts = username_accounts_mapper[alias]
|
||||||
elif alias.startswith('@'):
|
elif alias.startswith('@'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
accounts = []
|
|
||||||
if account:
|
if account:
|
||||||
accounts.append(account)
|
_accounts += [account]
|
||||||
if alias in username_accounts_mapper:
|
|
||||||
accounts += username_accounts_mapper[alias]
|
|
||||||
|
|
||||||
for account in accounts:
|
for account in _accounts:
|
||||||
cleaned_accounts_action_bit[account] |= action_bit
|
cleaned_accounts_action_bit[account] |= action_bit
|
||||||
cleaned_accounts_expired[account].extend(alias_date_expired_mapper[alias])
|
cleaned_accounts_expired[account].extend(alias_date_expired_mapper[alias])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user