From 72cd7a3be267f5966931d19ad2ad0ec709042cf3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 16 Apr 2018 17:01:25 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=9C=8B=E4=B8=8D=E5=88=B0=E6=88=91=E7=9A=84=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/perms/api.py b/apps/perms/api.py index f9b60dcb6..be69d6158 100644 --- a/apps/perms/api.py +++ b/apps/perms/api.py @@ -98,6 +98,11 @@ class UserGrantedNodesApi(ListAPIView): nodes = AssetPermissionUtil.get_user_nodes_with_assets(user) return nodes.keys() + def get_permissions(self): + if self.kwargs.get('pk') is None: + self.permission_classes = (IsValidUser,) + return super().get_permissions() + class UserGrantedNodesWithAssetsApi(ListAPIView): permission_classes = (IsSuperUserOrAppUser,)