mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
hold off on using new capabilities methodology on jobs
This commit is contained in:
@@ -2956,7 +2956,7 @@ class WorkflowJobRelaunch(WorkflowsEnforcementMixin, GenericAPIView):
|
|||||||
def check_object_permissions(self, request, obj):
|
def check_object_permissions(self, request, obj):
|
||||||
if request.method == 'POST' and obj:
|
if request.method == 'POST' and obj:
|
||||||
relaunch_perm, messages = request.user.can_access_with_errors(self.model, 'start', 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'])
|
self.permission_denied(request, message=messages['workflow_job_template'])
|
||||||
return super(WorkflowJobRelaunch, self).check_object_permissions(request, obj)
|
return super(WorkflowJobRelaunch, self).check_object_permissions(request, obj)
|
||||||
|
|
||||||
|
|||||||
@@ -1297,12 +1297,6 @@ class JobAccess(BaseAccess):
|
|||||||
def can_delete(self, obj):
|
def can_delete(self, obj):
|
||||||
return self.org_access(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):
|
def can_start(self, obj, validate_license=True):
|
||||||
if validate_license:
|
if validate_license:
|
||||||
self.check_license()
|
self.check_license()
|
||||||
|
|||||||
Reference in New Issue
Block a user