From bb13003a10a6ed0d7f25e814a1d0a826f2c70305 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 3 Sep 2018 19:41:44 +0800 Subject: [PATCH] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/api/asset.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/assets/api/asset.py b/apps/assets/api/asset.py index a4701add9..5c4802fa7 100644 --- a/apps/assets/api/asset.py +++ b/apps/assets/api/asset.py @@ -2,9 +2,8 @@ # import random -import time -from rest_framework import generics, permissions +from rest_framework import generics from rest_framework.response import Response from rest_framework_bulk import BulkModelViewSet from rest_framework_bulk import ListBulkCreateUpdateDestroyAPIView @@ -14,8 +13,8 @@ from django.db.models import Q from common.mixins import IDInFilterMixin from common.utils import get_logger -from common.permissions import IsOrgAdmin, IsAppUser, IsOrgAdminOrAppUser -from ..models import Asset, SystemUser, AdminUser, Node +from common.permissions import IsOrgAdmin, IsOrgAdminOrAppUser +from ..models import Asset, AdminUser, Node from .. import serializers from ..tasks import update_asset_hardware_info_manual, \ test_asset_connectability_manual @@ -40,7 +39,7 @@ class AssetViewSet(IDInFilterMixin, LabelFilter, BulkModelViewSet): queryset = Asset.objects.all() serializer_class = serializers.AssetSerializer pagination_class = LimitOffsetPagination - permission_classes = (permissions.AllowAny,) + permission_classes = (IsOrgAdminOrAppUser,) def filter_node(self): node_id = self.request.query_params.get("node_id")