mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 05:47:38 -02:30
IFF v2 api disallow direct job launches
This commit is contained in:
@@ -3739,6 +3739,13 @@ class JobList(ListCreateAPIView):
|
|||||||
methods.remove('POST')
|
methods.remove('POST')
|
||||||
return methods
|
return methods
|
||||||
|
|
||||||
|
# NOTE: Remove in 3.3, switch ListCreateAPIView to ListAPIView
|
||||||
|
def post(self, request, *args, **kwargs):
|
||||||
|
if get_request_version(self.request) > 1:
|
||||||
|
return Response({"error": _("POST not allowed for Job launching in version 2 of the api")},
|
||||||
|
status=status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||||
|
return super(JobList, self).post(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class JobDetail(UnifiedJobDeletionMixin, RetrieveUpdateDestroyAPIView):
|
class JobDetail(UnifiedJobDeletionMixin, RetrieveUpdateDestroyAPIView):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user