From cf75ea91a1f6bfda7098d37ebe484bbdf7f1de27 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 13 Feb 2019 10:29:26 -0500 Subject: [PATCH] Properly use the inventory in the can_start permissions checks --- awx/main/access.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index e688387753..5600abb9a8 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -1391,7 +1391,7 @@ class JobTemplateAccess(BaseAccess): self.check_license() # Check the per-org limit - self.check_org_host_limit({'inventory': obj}) + self.check_org_host_limit({'inventory': obj.inventory}) if obj.survey_enabled: self.check_license(feature='surveys') @@ -1552,7 +1552,7 @@ class JobAccess(BaseAccess): self.check_license() # Check the per-org limit - self.check_org_host_limit({'inventory': obj}) + self.check_org_host_limit({'inventory': obj.inventory}) # A super user can relaunch a job if self.user.is_superuser: @@ -1922,7 +1922,7 @@ class WorkflowJobTemplateAccess(BaseAccess): self.check_license() # Check the per-org limit - self.check_org_host_limit({'inventory': obj}) + self.check_org_host_limit({'inventory': obj.inventory}) # if surveys are added to WFJTs, check license here if obj.survey_enabled: @@ -1996,7 +1996,7 @@ class WorkflowJobAccess(BaseAccess): self.check_license() # Check the per-org limit - self.check_org_host_limit({'inventory': obj}) + self.check_org_host_limit({'inventory': obj.inventory}) if self.user.is_superuser: return True