perf: 资产授权添加协议

This commit is contained in:
ibuler
2023-10-26 19:19:09 +08:00
parent 996394ba29
commit f93979eb2d
18 changed files with 246 additions and 132 deletions

View File

@@ -21,7 +21,7 @@ from common.utils import get_object_or_none, lazyproperty
from common.utils.common import timeit
from perms.hands import Node
from perms.models import PermNode
from perms.utils import PermAccountUtil, UserPermNodeUtil
from perms.utils import PermAssetDetailUtil, UserPermNodeUtil
from perms.utils import UserPermAssetUtil
from .mixin import RebuildTreeMixin
from ..mixin import SelfOrPKUserMixin
@@ -225,8 +225,8 @@ class UserGrantedK8sAsTreeApi(SelfOrPKUserMixin, ListAPIView):
return token
def get_account_secret(self, token: ConnectionToken):
util = PermAccountUtil()
accounts = util.get_permed_accounts_for_user(self.user, token.asset)
util = PermAssetDetailUtil(self.user, token.asset)
accounts = util.get_permed_accounts_for_user()
account_name = token.account
if account_name in [AliasAccount.INPUT, AliasAccount.USER]: