perf: 开启安全模式后过滤root administrator (#10089)

Co-authored-by: feng <1304903146@qq.com>
pull/10094/head
fit2bot 2023-03-28 16:26:40 +08:00 committed by GitHub
parent 23b13db9e2
commit 8d3319717e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -78,7 +78,9 @@ class ChangeSecretManager(AccountBasePlaybookManager):
accounts = accounts.filter(secret_type=self.secret_type)
if settings.CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED:
accounts = accounts.filter(privileged=False)
accounts = accounts.filter(privileged=False).exclude(
username__in=['root', 'administrator']
)
return accounts
def host_callback(