[Bugfix] 修复动态系统用户登录windows的bug

pull/3781/head
ibuler 2020-03-16 16:13:54 +08:00
parent 3afb8647bd
commit 02a901467b
1 changed files with 6 additions and 0 deletions

View File

@ -158,6 +158,12 @@ class SystemUser(BaseUser):
def can_perm_to_asset(self):
return self.protocol not in [self.PROTOCOL_MYSQL]
def load_asset_special_auth(self, asset=None, username=None):
instance = super().load_asset_special_auth(asset=asset, username=username)
if self.username_same_with_user:
instance.username = username
return instance
@property
def cmd_filter_rules(self):
from .cmd_filter import CommandFilterRule