AC-505 Work in progress on cloud inventory sync.

This commit is contained in:
Chris Church
2013-10-07 23:21:31 -04:00
parent a968ee38f6
commit 1ffb40458c
18 changed files with 1494 additions and 296 deletions

View File

@@ -446,12 +446,17 @@ class InventorySourceAccess(BaseAccess):
return obj and self.user.can_access(Group, 'read', obj.group)
def can_add(self, data):
# Automatically created from group.
# Automatically created from group or management command.
return False
def can_change(self, obj, data):
# Checks for admin or change permission on group.
return obj and self.user.can_access(Group, 'change', obj.group, None)
if obj and obj.group:
return self.user.can_access(Group, 'change', obj.group, None)
# Can't change inventory sources attached to only the inventory, since
# these are created automatically from the management command.
else:
return False
class InventoryUpdateAccess(BaseAccess):
'''