From f0325c48df4e925bc6bf4163637f8e372957ccb5 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Fri, 11 Mar 2022 19:31:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=8D=95=E6=9D=83=E9=99=90=20(?= =?UTF-8?q?#7808)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng626 <1304903146@qq.com> --- apps/tickets/api/comment.py | 3 ++- apps/tickets/api/ticket.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/tickets/api/comment.py b/apps/tickets/api/comment.py index dc7740d1a..382ad2c99 100644 --- a/apps/tickets/api/comment.py +++ b/apps/tickets/api/comment.py @@ -4,6 +4,7 @@ from rest_framework import viewsets, mixins from common.exceptions import JMSException from common.utils import lazyproperty +from rbac.permissions import RBACPermission from tickets import serializers from tickets.models import Ticket from tickets.permissions.comment import IsAssignee, IsApplicant, IsSwagger @@ -14,7 +15,7 @@ __all__ = ['CommentViewSet'] class CommentViewSet(mixins.CreateModelMixin, viewsets.ReadOnlyModelViewSet): serializer_class = serializers.CommentSerializer - permission_classes = (IsSwagger | IsAssignee | IsApplicant,) + permission_classes = (RBACPermission| IsSwagger | IsAssignee | IsApplicant) @lazyproperty def ticket(self): diff --git a/apps/tickets/api/ticket.py b/apps/tickets/api/ticket.py index e61dda569..f112dae0c 100644 --- a/apps/tickets/api/ticket.py +++ b/apps/tickets/api/ticket.py @@ -19,7 +19,6 @@ __all__ = ['TicketViewSet', 'TicketFlowViewSet'] class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet): - permission_classes = (IsValidUser,) serializer_class = serializers.TicketDisplaySerializer serializer_classes = { 'open': serializers.TicketApplySerializer,