mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
use parent serializer method to avoid API browser job access check
This commit is contained in:
@@ -2137,9 +2137,10 @@ class JobTemplateLaunch(RetrieveAPIView, GenericAPIView):
|
|||||||
new_job.delete()
|
new_job.delete()
|
||||||
return Response(data, status=status.HTTP_400_BAD_REQUEST)
|
return Response(data, status=status.HTTP_400_BAD_REQUEST)
|
||||||
else:
|
else:
|
||||||
data = JobSerializer(new_job).data
|
data = OrderedDict()
|
||||||
data['job'] = new_job.id
|
|
||||||
data['ignored_fields'] = ignored_fields
|
data['ignored_fields'] = ignored_fields
|
||||||
|
data.update(JobSerializer(new_job).to_representation(new_job))
|
||||||
|
data['job'] = new_job.id
|
||||||
return Response(data, status=status.HTTP_201_CREATED)
|
return Response(data, status=status.HTTP_201_CREATED)
|
||||||
|
|
||||||
class JobTemplateSchedulesList(SubListCreateAttachDetachAPIView):
|
class JobTemplateSchedulesList(SubListCreateAttachDetachAPIView):
|
||||||
|
|||||||
@@ -766,7 +766,7 @@ class JobTemplateAccess(BaseAccess):
|
|||||||
self.check_license()
|
self.check_license()
|
||||||
if obj.job_type == PERM_INVENTORY_SCAN:
|
if obj.job_type == PERM_INVENTORY_SCAN:
|
||||||
self.check_license(feature='system_tracking')
|
self.check_license(feature='system_tracking')
|
||||||
if getattr(obj, 'survey_enabled', None):
|
if obj.survey_enabled:
|
||||||
self.check_license(feature='surveys')
|
self.check_license(feature='surveys')
|
||||||
|
|
||||||
# Super users can start any job
|
# Super users can start any job
|
||||||
|
|||||||
Reference in New Issue
Block a user