Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

344
Views
JWT, ¿cómo escribir sobre el permiso del usuario en Django sin sesión?

Tenía un permiso a continuación cuando mi servidor tenía autenticación basada en cookies.

 class IsAuthenticatedAndStudentOwner(BasePermission): message = 'You must be a student.' def has_permission(self, request, view): return request.user.is_authenticated() and smart_str(request.user.identity) == 'student' def has_object_permission(self, request, view, obj): return obj.student.user == request.user

Luego, cuando uso JWT, ese request.user devuelve AnonymousUser .

 # login(request, user_obj) payload = jwt_payload_handler(user_obj) token = jwt_encode_handler(payload) data['token'] = token return data

Entonces, ¿cómo puedo escribir este permission sin sesión?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!