From 2da1189a7cd697e4b7b94d8486ef5b83a516a067 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 5 Sep 2014 14:54:33 -0400 Subject: [PATCH] Change access to only allow super users to post to the jobs list without a job template --- awx/main/access.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/main/access.py b/awx/main/access.py index 942450aa7a..b2ba36ae85 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -1011,6 +1011,9 @@ class JobAccess(BaseAccess): add_data.setdefault('credential', job_template.credential.pk) else: job_template = None + # Only admins can create jobs without job templates + if not self.user.is_superuser: + return False # Check that the user would be able to add a job template with the # same data.