i want to check user permissions and then give him access to proxy.
but when i want to check request.user and its permissions, it give me Anonymous user however it is not anonymous!!!
def process_request(self, proxy, request, **kwargs):
if request.method != 'OPTIONS':
_u = User.objects.get(username=request.user)
if not _u.has_perm('dummy.cm'):
return HttpResponse({"status": -1, "msg": "you don't have permission to be here"}, content_type='application/json', status=HTTP_403_FORBIDDEN)
else:
return response
else:
return response
i want to check user permissions and then give him access to proxy. but when i want to check request.user and its permissions, it give me
Anonymous user
however it is not anonymous!!!