mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 00:09:14 +00:00
usermodle
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#coding: utf-8
|
||||
# coding: utf-8
|
||||
|
||||
from django.db import models
|
||||
|
||||
@@ -19,6 +19,21 @@ class UserGroup(models.Model):
|
||||
self.save()
|
||||
|
||||
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
class CustomUser(AbstractUser):
|
||||
USER_ROLE_CHOICES = (
|
||||
('SU', 'SuperUser'),
|
||||
('GA', 'GroupAdmin'),
|
||||
('CU', 'CommonUser'),
|
||||
)
|
||||
name = models.CharField(max_length=80)
|
||||
uuid = models.CharField(max_length=100)
|
||||
role = models.CharField(max_length=2, choices=USER_ROLE_CHOICES, default='CU')
|
||||
group = models.ManyToManyField(UserGroup)
|
||||
ssh_key_pwd = models.CharField(max_length=200)
|
||||
|
||||
|
||||
class User(models.Model):
|
||||
USER_ROLE_CHOICES = (
|
||||
('SU', 'SuperUser'),
|
||||
@@ -137,5 +152,3 @@ class AdminGroup(models.Model):
|
||||
|
||||
def __unicode__(self):
|
||||
return '%s: %s' % (self.user.username, self.group.name)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user