Some testing and bug fixes for scan job templates

This commit is contained in:
Matthew Jones
2015-03-06 11:00:28 -05:00
parent 987a898380
commit 3d46a4ce37
2 changed files with 23 additions and 2 deletions

View File

@@ -928,9 +928,9 @@ class JobTemplateAccess(BaseAccess):
project_pk = get_pk_from_dict(data, 'project')
if 'job_type' in data and data['job_type'] == PERM_INVENTORY_SCAN:
if not project_pk and self.user.can_access(Organization, 'change', inventory.organization, None):
if not project_pk and self.user.can_access(Organization, 'change', inventory[0].organization, None):
return True
elif not self.user.can_access(Organization, "change", inventory.organization, None):
elif not self.user.can_access(Organization, "change", inventory[0].organization, None):
return False
# If the user has admin access to the project (as an org admin), should
# be able to proceed without additional checks.