mirror of
https://github.com/ansible/awx.git
synced 2026-01-27 08:31:28 -03:30
hold off on using new capabilities methodology on jobs
This commit is contained in:
parent
1a26a1796b
commit
93564987d1
@ -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)
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user