mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 10:40:01 -03:30
Properly use the inventory in the can_start permissions checks
This commit is contained in:
@@ -1391,7 +1391,7 @@ class JobTemplateAccess(BaseAccess):
|
|||||||
self.check_license()
|
self.check_license()
|
||||||
|
|
||||||
# Check the per-org limit
|
# Check the per-org limit
|
||||||
self.check_org_host_limit({'inventory': obj})
|
self.check_org_host_limit({'inventory': obj.inventory})
|
||||||
|
|
||||||
if obj.survey_enabled:
|
if obj.survey_enabled:
|
||||||
self.check_license(feature='surveys')
|
self.check_license(feature='surveys')
|
||||||
@@ -1552,7 +1552,7 @@ class JobAccess(BaseAccess):
|
|||||||
self.check_license()
|
self.check_license()
|
||||||
|
|
||||||
# Check the per-org limit
|
# 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
|
# A super user can relaunch a job
|
||||||
if self.user.is_superuser:
|
if self.user.is_superuser:
|
||||||
@@ -1922,7 +1922,7 @@ class WorkflowJobTemplateAccess(BaseAccess):
|
|||||||
self.check_license()
|
self.check_license()
|
||||||
|
|
||||||
# Check the per-org limit
|
# 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 surveys are added to WFJTs, check license here
|
||||||
if obj.survey_enabled:
|
if obj.survey_enabled:
|
||||||
@@ -1996,7 +1996,7 @@ class WorkflowJobAccess(BaseAccess):
|
|||||||
self.check_license()
|
self.check_license()
|
||||||
|
|
||||||
# Check the per-org limit
|
# 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:
|
if self.user.is_superuser:
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user