def resource_approve_view(request, id):
    if not request.user.is_staff:
        return HttpResponse(status=401, content="Not Authorized")
    resource = Resource.objects.get(pk=id)
    resource.status = Resource.APPROVED
    resource.save()

    resource_workflow.send(sender=resource, resource=resource,
                           request=request, status=Resource.APPROVED, notes="")
    return render(request, 'orb/resource/status_updated.html', {'resource': resource})