Skip to content

Commit

Permalink
fix: 处理模板 batch_delete 权限问题 #7572
Browse files Browse the repository at this point in the history
(cherry picked from commit d03c65f)
  • Loading branch information
normal-wls committed Sep 27, 2024
1 parent 5b70673 commit 19fd4bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gcloud/template_base/apis/drf/viewsets/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
import logging

from drf_yasg.utils import swagger_auto_schema
from rest_framework import viewsets, permissions
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.exceptions import APIException
from rest_framework.response import Response

from gcloud.common_template.models import CommonTemplate
from gcloud.core.apis.drf.viewsets import ApiMixin
from gcloud.tasktmpl3.models import TaskTemplate
from gcloud.template_base.apis.drf.permission import ProjectTemplatePermission, CommonTemplatePermission
from gcloud.template_base.apis.drf.serilaziers.template import TemplateIdsSerializer, BatchDeleteSerialzer
from gcloud.template_base.apis.drf.permission import CommonTemplatePermission, ProjectTemplatePermission
from gcloud.template_base.apis.drf.serilaziers.template import BatchDeleteSerialzer, TemplateIdsSerializer
from gcloud.template_base.domains.template_manager import TemplateManager

logger = logging.getLogger("root")
Expand All @@ -49,13 +49,13 @@ def batch_delete(self, request, *args, **kwargs):

class ProjectTemplateViewSet(TemplateViewSet):
queryset = TaskTemplate.objects.all()
permission_classes = [permissions.IsAuthenticated | ProjectTemplatePermission]
permission_classes = [ProjectTemplatePermission]
template_type = "project"
tmpl_model = TaskTemplate


class CommonTemplateViewSet(TemplateViewSet):
queryset = CommonTemplate.objects.all()
permission_classes = [permissions.IsAuthenticated | CommonTemplatePermission]
permission_classes = [CommonTemplatePermission]
template_type = "common"
tmpl_model = CommonTemplate

0 comments on commit 19fd4bd

Please sign in to comment.