mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Check license before launching job template and disallow scan job
template launch if license is unsupported
This commit is contained in:
parent
82ac560cf2
commit
06464333a6
@ -1708,6 +1708,7 @@ class JobTemplateLaunch(RetrieveAPIView, GenericAPIView):
|
||||
model = JobTemplate
|
||||
serializer_class = JobLaunchSerializer
|
||||
is_job_start = True
|
||||
always_allow_superuser = False
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
obj = self.get_object()
|
||||
|
||||
@ -997,7 +997,11 @@ class JobTemplateAccess(BaseAccess):
|
||||
def can_start(self, obj, validate_license=True):
|
||||
# Check license.
|
||||
if validate_license:
|
||||
self.check_license()
|
||||
k = {}
|
||||
if obj.job_type == PERM_INVENTORY_SCAN:
|
||||
print("In perm inv scan test")
|
||||
k = dict(feature='system_tracking')
|
||||
self.check_license(**k)
|
||||
|
||||
# Super users can start any job
|
||||
if self.user.is_superuser:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user