Commit 45a354f8 authored by BaiJiangJie's avatar BaiJiangJie

[Bugfix] 修复org下普通用户打开web终端看不到已被授权的资产和节点bug

parent a48fb9de
......@@ -14,6 +14,8 @@ from .models import AssetPermission
from .hands import AssetGrantedSerializer, User, UserGroup, Asset, Node, \
NodeGrantedSerializer, SystemUser, NodeSerializer
from . import serializers
from orgs.utils import set_current_org
from orgs.models import Organization
class AssetPermissionViewSet(viewsets.ModelViewSet):
......@@ -128,6 +130,7 @@ class UserGrantedNodesWithAssetsApi(ListAPIView):
return queryset
def get_permissions(self):
set_current_org(Organization.root())
if self.kwargs.get('pk') is None:
self.permission_classes = (IsValidUser,)
return super().get_permissions()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment