fix: 修改用户授权的资产账号

This commit is contained in:
Jiangjie.Bai
2022-11-15 17:49:28 +08:00
parent ed26c7f575
commit 3e31c9ed7f
3 changed files with 25 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
from django.shortcuts import get_object_or_404
from rest_framework.generics import ListAPIView, get_object_or_404
from common.utils import get_logger
from common.utils import get_logger, lazyproperty
from perms import serializers
from perms.hands import Asset
from perms.utils import PermAccountUtil
@@ -16,11 +16,8 @@ __all__ = [
class UserGrantedAssetAccountsApi(SelfOrPKUserMixin, ListAPIView):
serializer_class = serializers.AccountsGrantedSerializer
rbac_perms = (
('GET', 'perms.view_userassets'),
('list', 'perms.view_userassets'),
)
@lazyproperty
def asset(self):
asset_id = self.kwargs.get('asset_id')
kwargs = {'id': asset_id, 'is_active': True}