|
|
@ -4,17 +4,16 @@ from jasset.models import Asset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Permission(models.Model):
|
|
|
|
class Permission(models.Model):
|
|
|
|
PERM_USER_TYPE_CHOICE = (
|
|
|
|
USER_ROLE_CHOICES = (
|
|
|
|
('S', 'Super'),
|
|
|
|
('SU', 'SuperUser'),
|
|
|
|
('C', 'Common'),
|
|
|
|
('CU', 'CommonUser'),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
user = models.ForeignKey(User)
|
|
|
|
user = models.ForeignKey(User)
|
|
|
|
asset = models.ForeignKey(Asset)
|
|
|
|
asset = models.ForeignKey(Asset)
|
|
|
|
is_ldap = models.BooleanField(default=True)
|
|
|
|
role = models.CharField(choices=USER_ROLE_CHOICES,
|
|
|
|
perm_user_type = models.CharField(choices=PERM_USER_TYPE_CHOICE,
|
|
|
|
max_length=1,
|
|
|
|
max_length=1,
|
|
|
|
blank=True,
|
|
|
|
blank=True,
|
|
|
|
null=True)
|
|
|
|
null=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
def __unicode__(self):
|
|
|
|
return '%s_%s' % (self.user.username, self.asset.ip)
|
|
|
|
return '%s_%s' % (self.user.username, self.asset.ip)
|