Check license before launching job template and disallow scan job

template launch if license is unsupported
This commit is contained in:
Matthew Jones 2015-06-01 14:15:42 -04:00
parent 82ac560cf2
commit 06464333a6
2 changed files with 6 additions and 1 deletions

View File

@ -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()

View File

@ -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: