Commit 3dc214d1 authored by BaiJiangJie's avatar BaiJiangJie

[Bugfix] 修复org下用户查看我的资产不显示已授权节点/资产的bug

parent 8f654c37
...@@ -101,6 +101,7 @@ class UserGrantedNodesApi(ListAPIView): ...@@ -101,6 +101,7 @@ class UserGrantedNodesApi(ListAPIView):
return nodes.keys() return nodes.keys()
def get_permissions(self): def get_permissions(self):
set_current_org(Organization.root())
if self.kwargs.get('pk') is None: if self.kwargs.get('pk') is None:
self.permission_classes = (IsValidUser,) self.permission_classes = (IsValidUser,)
return super().get_permissions() return super().get_permissions()
...@@ -157,6 +158,7 @@ class UserGrantedNodeAssetsApi(ListAPIView): ...@@ -157,6 +158,7 @@ class UserGrantedNodeAssetsApi(ListAPIView):
return assets return assets
def get_permissions(self): def get_permissions(self):
set_current_org(Organization.root())
if self.kwargs.get('pk') is None: if self.kwargs.get('pk') is None:
self.permission_classes = (IsValidUser,) self.permission_classes = (IsValidUser,)
return super().get_permissions() 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