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.
jumpserver/jpermission/models.py

19 lines
552 B

from django.db import models
from juser.models import User
from jasset.models import Asset
class Permission(models.Model):
10 years ago
USER_ROLE_CHOICES = (
('SU', 'SuperUser'),
('CU', 'CommonUser'),
)
user = models.ForeignKey(User)
asset = models.ForeignKey(Asset)
10 years ago
role = models.CharField(choices=USER_ROLE_CHOICES,
10 years ago
max_length=2,
10 years ago
blank=True,
null=True)
def __unicode__(self):
return '%s_%s' % (self.user.username, self.asset.ip)