fix global schedule creation for project and inventory updates too

related: https://github.com/ansible/awx/pull/6193
This commit is contained in:
Ryan Petrello 2020-03-06 08:21:20 -05:00
parent a1c2db3db5
commit acc34c1393
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -2430,9 +2430,7 @@ class ScheduleAccess(BaseAccess):
if not JobLaunchConfigAccess(self.user).can_add(data):
return False
if not data:
return UnifiedJobTemplate.accessible_pk_qs(
self.user, 'execute_role'
).exists()
return Role.objects.filter(role_field__in=['update_role', 'execute_role'], ancestors__in=self.user.roles.all()).exists()
return self.check_related('unified_job_template', UnifiedJobTemplate, data, role_field='execute_role', mandatory=True)