perf: support only su or sudo

pull/13916/head
Eric 2024-08-06 19:32:53 +08:00 committed by Bryan
parent 2b133a8085
commit 9b6b48a7f1
2 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class HostTypes(BaseType):
'charset': 'utf-8', # default
'domain_enabled': True,
'su_enabled': True,
'su_methods': ['sudo', 'su'],
'su_methods': ['sudo', 'su', 'only_sudo', 'only_su'],
},
cls.WINDOWS: {
'su_enabled': False,

View File

@ -127,6 +127,8 @@ class PlatformSerializer(ResourceLabelsMixin, WritableNestedModelSerializer):
SU_METHOD_CHOICES = [
("sudo", "sudo su -"),
("su", "su - "),
("only_sudo", "sudo su"),
("only_su", "su"),
("enable", "enable"),
("super", "super 15"),
("super_level", "super level 15")