From e731c01cc403386b8fb7a7c750029d04ba6e0b88 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Wed, 13 Nov 2019 11:18:29 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=20sytem-user-asse?= =?UTF-8?q?t-auth-info=20API=20=E7=9A=84=E6=9D=83=E9=99=90=EF=BC=88?= =?UTF-8?q?=E5=8F=AA=E5=85=81=E8=AE=B8=20App=EF=BC=89=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/api/system_user.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/assets/api/system_user.py b/apps/assets/api/system_user.py index db0751343..f1213f0a3 100644 --- a/apps/assets/api/system_user.py +++ b/apps/assets/api/system_user.py @@ -19,7 +19,7 @@ from rest_framework.response import Response from common.serializers import CeleryTaskSerializer from common.utils import get_logger -from common.permissions import IsOrgAdmin, IsOrgAdminOrAppUser, NeedMFAVerify +from common.permissions import IsOrgAdmin, IsOrgAdminOrAppUser, IsAppUser from orgs.mixins.api import OrgBulkModelViewSet from orgs.mixins import generics from ..models import SystemUser, Asset @@ -70,14 +70,9 @@ class SystemUserAssetAuthInfoApi(generics.RetrieveAPIView): Get system user with asset auth info """ model = SystemUser - permission_classes = (IsOrgAdminOrAppUser,) + permission_classes = (IsAppUser,) serializer_class = serializers.SystemUserAuthSerializer - def get_permissions(self): - if settings.CONFIG.SECURITY_VIEW_AUTH_NEED_MFA: - self.permission_classes = (IsOrgAdminOrAppUser, NeedMFAVerify) - return super().get_permissions() - def get_object(self): instance = super().get_object() aid = self.kwargs.get('aid')