1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 13:55:31 +03:00

Merge pull request #6205 from ryanpetrello/proj-inv-sched

fix global schedule creation for project and inventory updates too

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-03-06 14:36:22 +00:00 committed by GitHub
commit 73e867b6f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)