From 45a354f8488d93d51ee275c9f339040234685e25 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Fri, 27 Jul 2018 10:42:32 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8Dorg=E4=B8=8B?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E7=94=A8=E6=88=B7=E6=89=93=E5=BC=80web?= =?UTF-8?q?=E7=BB=88=E7=AB=AF=E7=9C=8B=E4=B8=8D=E5=88=B0=E5=B7=B2=E8=A2=AB?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E7=9A=84=E8=B5=84=E4=BA=A7=E5=92=8C=E8=8A=82?= =?UTF-8?q?=E7=82=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/perms/api.py b/apps/perms/api.py index 3851d401a..6d249993d 100644 --- a/apps/perms/api.py +++ b/apps/perms/api.py @@ -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()