Merge pull request #6246 from wwitzel3/issue-5756

Create /inventories/N/update_inventory_sources endpoint.
This commit is contained in:
Wayne Witzel III
2017-05-12 17:30:00 -04:00
committed by GitHub
6 changed files with 96 additions and 3 deletions

View File

@@ -613,6 +613,10 @@ class InventoryAccess(BaseAccess):
# inventory to a new organization. Otherwise, just check for admin permission.
return self.check_related('organization', Organization, data, obj=obj) and self.user in obj.admin_role
@check_superuser
def can_update(self, obj):
return self.user in obj.update_role
def can_delete(self, obj):
is_can_admin = self.can_admin(obj, None)
if not is_can_admin: