fix(auditor): 修复审计员无法访问命令列表的bug

pull/5754/head
ibuler 2021-03-15 14:34:40 +08:00 committed by Jiangjie.Bai
parent 7dfd0ee8fe
commit 7f4377b0e8
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ from django_filters import utils
from terminal import const
from common.const.http import GET
from common.permissions import IsSuperUser
from common.permissions import IsSuperUser, IsOrgAuditor
from terminal.filters import CommandStorageFilter, CommandFilter, CommandFilterForStorageTree
from ..models import CommandStorage, ReplayStorage
from ..serializers import CommandStorageSerializer, ReplayStorageSerializer
@ -42,7 +42,7 @@ class CommandStorageViewSet(BaseStorageViewSetMixin, viewsets.ModelViewSet):
permission_classes = (IsSuperUser,)
filterset_class = CommandStorageFilter
@action(methods=[GET], detail=False, filterset_class=CommandFilterForStorageTree)
@action(methods=[GET], detail=False, permission_classes=(IsOrgAuditor, ), filterset_class=CommandFilterForStorageTree)
def tree(self, request: Request):
storage_qs = self.get_queryset().exclude(name='null')
storages_with_count = []