diff --git a/apps/assets/const/host.py b/apps/assets/const/host.py index f408e5e5e..91942e294 100644 --- a/apps/assets/const/host.py +++ b/apps/assets/const/host.py @@ -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, diff --git a/apps/assets/serializers/platform.py b/apps/assets/serializers/platform.py index b4d3207fd..0bf33fd6e 100644 --- a/apps/assets/serializers/platform.py +++ b/apps/assets/serializers/platform.py @@ -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 rest_framework import serializers from rest_framework.validators import UniqueValidator @@ -162,6 +162,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")