perf: 修改 CommandFilterACL, CommandGroup Model 的 Meta 内部类; 修改 Command Model 的 system_user -> account 字段; 修改 ConnectionToken 的 command_filter_acls 返回字段;

This commit is contained in:
Bai
2022-12-05 13:27:51 +08:00
parent 0cfcfacb6d
commit cc7424dbfe
16 changed files with 106 additions and 60 deletions

View File

@@ -160,15 +160,15 @@ class ConnectionToken(OrgModelMixin, JMSBaseModel):
return self.domain.random_gateway()
@lazyproperty
def acl_command_groups(self):
def command_filter_acls(self):
from acls.models import CommandFilterACL
kwargs = {
'user': self.user,
'asset': self.asset,
'account': self.account,
}
command_groups = CommandFilterACL.filter_queryset(**kwargs).get_command_groups()
return command_groups
acls = CommandFilterACL.filter_queryset(**kwargs).valid()
return acls
class SuperConnectionToken(ConnectionToken):