|
|
@ -62,11 +62,15 @@ class UserAssetAccountACLQuerySet(BaseACLQuerySet):
|
|
|
|
return self.filter(q)
|
|
|
|
return self.filter(q)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ACLManager(OrgManager):
|
|
|
|
class ACLManager(models.Manager):
|
|
|
|
def valid(self):
|
|
|
|
def valid(self):
|
|
|
|
return self.get_queryset().valid()
|
|
|
|
return self.get_queryset().valid()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class OrgACLManager(OrgManager, ACLManager):
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BaseACL(JMSBaseModel):
|
|
|
|
class BaseACL(JMSBaseModel):
|
|
|
|
name = models.CharField(max_length=128, verbose_name=_('Name'))
|
|
|
|
name = models.CharField(max_length=128, verbose_name=_('Name'))
|
|
|
|
priority = models.IntegerField(
|
|
|
|
priority = models.IntegerField(
|
|
|
@ -97,7 +101,7 @@ class UserAssetAccountBaseACL(BaseACL, OrgModelMixin):
|
|
|
|
# username_group
|
|
|
|
# username_group
|
|
|
|
accounts = models.JSONField(verbose_name=_('Account'))
|
|
|
|
accounts = models.JSONField(verbose_name=_('Account'))
|
|
|
|
|
|
|
|
|
|
|
|
objects = ACLManager.from_queryset(UserAssetAccountACLQuerySet)()
|
|
|
|
objects = OrgACLManager.from_queryset(UserAssetAccountACLQuerySet)()
|
|
|
|
|
|
|
|
|
|
|
|
class Meta(BaseACL.Meta):
|
|
|
|
class Meta(BaseACL.Meta):
|
|
|
|
unique_together = ('name', 'org_id')
|
|
|
|
unique_together = ('name', 'org_id')
|
|
|
|