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