#32255: User.has_perm should forward **kwargs to allow more flexibility in
authentication backends
-------------------------------------+-------------------------------------
     Reporter:  Matteo Parrucci      |                    Owner:  Matteo
                                     |  Parrucci
         Type:  New feature          |                   Status:  assigned
    Component:  contrib.auth         |                  Version:  3.1
     Severity:  Normal               |               Resolution:
     Keywords:  auth,                |             Triage Stage:  Accepted
  django.contrib.auth,               |
  authentication, request,           |
  has_perm, has_perms, sites,        |
  django.contrib.sites               |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Florian Apolloner):

 * cc: Florian Apolloner (added)


Comment:

 > And what if there are no more kwargs and has_perm gets and forwards to
 the backends simply the request as context?

 That would work, but would add strong coupling to the request cycle, which
 is imo rather ugly. And yes, we already have it for `authenticate` but I
 still don't like it -- although it might be the better option in that
 regard :/ And even if we were to do that, we'd need to adjust
 https://github.com/django/django/blob/master/django/contrib/auth/decorators.py
 otherwise you'd probably get the request passed in 10% of the cases.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32255#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.b5a2da58158f9ac47c9780fa3e9c233a%40djangoproject.com.

Reply via email to