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()