From b4cc024d50ab0778312cbf8a437a60fce56cd49a Mon Sep 17 00:00:00 2001 From: Aaron Tan Date: Mon, 21 Nov 2016 11:37:59 -0500 Subject: [PATCH] Implement wfjt access list. --- awx/api/serializers.py | 1 + awx/api/urls.py | 1 + awx/api/views.py | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index e8b0706789..bda037c878 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -2216,6 +2216,7 @@ class WorkflowJobTemplateSerializer(LabelsListMixin, UnifiedJobTemplateSerialize notification_templates_any = reverse('api:workflow_job_template_notification_templates_any_list', args=(obj.pk,)), notification_templates_success = reverse('api:workflow_job_template_notification_templates_success_list', args=(obj.pk,)), notification_templates_error = reverse('api:workflow_job_template_notification_templates_error_list', args=(obj.pk,)), + access_list = reverse('api:workflow_job_template_access_list', args=(obj.pk,)), survey_spec = reverse('api:workflow_job_template_survey_spec', args=(obj.pk,)), )) return res diff --git a/awx/api/urls.py b/awx/api/urls.py index f0bc97e99e..d62768224b 100644 --- a/awx/api/urls.py +++ b/awx/api/urls.py @@ -268,6 +268,7 @@ workflow_job_template_urls = patterns('awx.api.views', url(r'^(?P[0-9]+)/notification_templates_any/$', 'workflow_job_template_notification_templates_any_list'), url(r'^(?P[0-9]+)/notification_templates_error/$', 'workflow_job_template_notification_templates_error_list'), url(r'^(?P[0-9]+)/notification_templates_success/$', 'workflow_job_template_notification_templates_success_list'), + url(r'^(?P[0-9]+)/access_list/$', 'workflow_job_template_access_list'), url(r'^(?P[0-9]+)/labels/$', 'workflow_job_template_label_list'), # url(r'^(?P[0-9]+)/cancel/$', 'workflow_job_template_cancel'), ) diff --git a/awx/api/views.py b/awx/api/views.py index 17167598a3..b22be1771d 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -3080,6 +3080,13 @@ class WorkflowJobNotificationsList(SubListAPIView): new_in_310 = True +class WorkflowJobTemplateAccessList(ResourceAccessList): + + model = User # needs to be User for AccessLists's + resource_model = WorkflowJobTemplate + new_in_310 = True + + class SystemJobTemplateList(ListAPIView): model = SystemJobTemplate