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

pull/1602/head
BaiJiangJie 2018-07-27 15:24:09 +08:00
parent 8f654c37a9
commit 3dc214d1fa
1 changed files with 2 additions and 0 deletions

View File

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