From 93564987d1ecca6e9aa4c2a0a0180b7558115655 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 20 Dec 2016 08:18:13 -0500 Subject: [PATCH] hold off on using new capabilities methodology on jobs --- awx/api/views.py | 2 +- awx/main/access.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/awx/api/views.py b/awx/api/views.py index dc49d55e64..219c48ce4e 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2956,7 +2956,7 @@ class WorkflowJobRelaunch(WorkflowsEnforcementMixin, GenericAPIView): def check_object_permissions(self, request, obj): if request.method == 'POST' and obj: relaunch_perm, messages = request.user.can_access_with_errors(self.model, 'start', obj) - if not relaunch_perm: + if not relaunch_perm and 'workflow_job_template' in messages: self.permission_denied(request, message=messages['workflow_job_template']) return super(WorkflowJobRelaunch, self).check_object_permissions(request, obj) diff --git a/awx/main/access.py b/awx/main/access.py index 9054ab7b94..f294aa6cda 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -1297,12 +1297,6 @@ class JobAccess(BaseAccess): def can_delete(self, obj): return self.org_access(obj) - def get_method_capability(self, method, obj, parent_obj): - if method == 'start': - # Return simplistic permission, will perform detailed check on POST - return (not obj.job_template) or self.user in obj.job_template.execute_role - return super(JobAccess, self).get_method_capability(method, obj, parent_obj) - def can_start(self, obj, validate_license=True): if validate_license: self.check_license()