mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
673 B
26 lines
673 B
# -*- coding: utf-8 -*-
|
|
#
|
|
from ..models import SystemUser
|
|
from .system_user import SystemUserSerializer as SuS
|
|
|
|
|
|
class AdminUserSerializer(SuS):
|
|
"""
|
|
管理用户
|
|
"""
|
|
|
|
class Meta(SuS.Meta):
|
|
fields = SuS.Meta.fields_mini + \
|
|
SuS.Meta.fields_write_only + \
|
|
SuS.Meta.fields_m2m + \
|
|
[
|
|
'type', 'protocol', "priority", 'sftp_root', 'ssh_key_fingerprint',
|
|
'date_created', 'date_updated', 'comment', 'created_by',
|
|
]
|
|
|
|
def validate_type(self, val):
|
|
return SystemUser.Type.admin
|
|
|
|
def validate_protocol(self, val):
|
|
return 'ssh'
|