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