doc = get_object_or_404(Document, pk=pk, deleted=False)
if not doc.can_edit(request.user):
return HttpResponseForbidden("Not authorized.")
doc = get_object_or_404(Document, pk=pk, deleted=False)
if not doc.can_edit(request.user):
return HttpResponseForbidden("Not authorized.")