perf: support only su or sudo

pull/13914/head
Eric 4 months ago committed by Bryan
parent 581a5c73a6
commit 0c73acd4b9

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

@ -1,4 +1,4 @@
from django.db.models import QuerySet, Count from django.db.models import QuerySet
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from rest_framework import serializers from rest_framework import serializers
from rest_framework.validators import UniqueValidator from rest_framework.validators import UniqueValidator
@ -162,6 +162,8 @@ class PlatformSerializer(ResourceLabelsMixin, WritableNestedModelSerializer):
SU_METHOD_CHOICES = [ SU_METHOD_CHOICES = [
("sudo", "sudo su -"), ("sudo", "sudo su -"),
("su", "su - "), ("su", "su - "),
("only_sudo", "sudo su"),
("only_su", "su"),
("enable", "enable"), ("enable", "enable"),
("super", "super 15"), ("super", "super 15"),
("super_level", "super level 15") ("super_level", "super level 15")

Loading…
Cancel
Save