Skip to content

Commit 920d068

Browse files
Merge pull request #628 from weni-ai/feature/change-internal-whatsappbroadcast-auth
Add possiblity to use IsUserOrg in internal whatsapp broadcast API
2 parents a6320a0 + 4d35153 commit 920d068

File tree

1 file changed

+2
-1
lines changed
  • temba/api/v2/internals/broadcasts

1 file changed

+2
-1
lines changed

temba/api/v2/internals/broadcasts/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from django.contrib.auth import get_user_model
1212

1313
from temba.api.v2.internals.views import APIViewMixin
14+
from temba.api.v2.permissions import IsUserInOrg
1415
from temba.api.v2.serializers import WhatsappBroadcastWriteSerializer
1516
from temba.orgs.models import Org
1617

@@ -50,7 +51,7 @@ def create(self, request, *args, **kwargs):
5051

5152
class InternalWhatsappBroadcastsEndpoint(APIViewMixin, APIView):
5253
authentication_classes = [InternalOIDCAuthentication]
53-
permission_classes = [IsAuthenticated, CanCommunicateInternally]
54+
permission_classes = [IsAuthenticated & (CanCommunicateInternally | IsUserInOrg)]
5455

5556
def post(self, request, *args, **kwargs):
5657
project_uuid = request.data.get("project")

0 commit comments

Comments
 (0)