access-control

Restrict access per customer in django

Restrict access per customer in django Question: I am trying to restrict access to records based on each customer so users can’t access each others data through URL. I have added this but its restricting everything. if request.user.customer != Infringement.customer: return HttpResponse(‘Your are not allowed here!!’)" views.py @login_required(login_url=’login’) def infringement(request, pk): if request.user.customer != Infringement.customer: …

Total answers: 1