SCM Inventory model, view, and task system changes

Inventory source file-type combined with a linked project
will allow the inventory source to be updated when the
project is updated. The inventory update runs in the
post-run hook of the project update.
This commit is contained in:
AlanCoding
2017-03-27 09:56:36 -04:00
parent 2c34aef661
commit 6d92c56da5
18 changed files with 516 additions and 47 deletions

View File

@@ -765,9 +765,12 @@ class InventorySourceAccess(BaseAccess):
else:
return False
@check_superuser
def can_add(self, data):
if not data or 'inventory' not in data:
return False
if not self.check_related('scm_project', Project, data, role_field='admin_role'):
return False
# Checks for admin or change permission on inventory.
return self.check_related('inventory', Inventory, data)