1
0
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:
AlanCoding 2016-04-13 15:19:10 -04:00
parent 914918b5ae
commit dc37f00d0a
2 changed files with 4 additions and 3 deletions

View File

@ -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):

View File

@ -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