adjusting Credential model and migrations

This commit is contained in:
Wayne Witzel III
2016-06-10 13:23:32 -04:00
parent 2c05df064b
commit 5754b4bb2c
4 changed files with 55 additions and 13 deletions

View File

@@ -78,6 +78,14 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
on_delete=models.CASCADE,
related_name='deprecated_credentials',
)
organization = models.ForeignKey(
'Organization',
null=True,
default=None,
blank=True,
on_delete=models.CASCADE,
related_name='credentials',
)
kind = models.CharField(
max_length=32,
choices=KIND_CHOICES,
@@ -209,7 +217,10 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
],
)
use_role = ImplicitRoleField(
parent_role=['owner_role']
parent_role=[
'organization.admin_role',
'owner_role',
]
)
read_role = ImplicitRoleField(parent_role=[
'singleton:' + ROLE_SINGLETON_SYSTEM_AUDITOR,