def wrap(controller, request, *args, **kwargs):
    if (request.user and request.user.is_authenticated):
        response = Response()
        return JsonResponse(response.send_private_failure([{'type': 'error', 'message': _('Error! Access forbidden for authenticated users.')}]))
    return function(controller, request, *args, **kwargs)
def wrap(controller, request, *args, **kwargs):
    if (request.user and request.user.is_authenticated):
        response = Response()
        return JsonResponse(response.send_private_failure([{'type': 'error', 'message': _('Error! Access forbidden for authenticated users.')}]))
    return function(controller, request, *args, **kwargs)