From acc34c13933c36ccd2f5b45ffd3b5c6d7e892d70 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 6 Mar 2020 08:21:20 -0500 Subject: [PATCH] fix global schedule creation for project and inventory updates too related: https://github.com/ansible/awx/pull/6193 --- awx/main/access.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index 29778b05d6..95ec0f20a8 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -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)