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

@@ -4,9 +4,10 @@ from rest_framework.generics import ListAPIView, get_object_or_404
from common.utils import get_logger, lazyproperty
from perms import serializers
from perms.hands import Asset
from perms.utils import PermAccountUtil
from perms.utils import PermAssetDetailUtil
from .mixin import SelfOrPKUserMixin
from ...models import AssetPermission
logger = get_logger(__name__)
__all__ = [
@@ -26,5 +27,5 @@ class UserPermedAssetAccountsApi(SelfOrPKUserMixin, ListAPIView):
return asset
def get_queryset(self):
accounts = PermAccountUtil().get_permed_accounts_for_user(self.user, self.asset)
accounts = PermAssetDetailUtil(self.user, self.asset).get_permed_accounts_for_user()
return accounts