#25142: Refactor access mixins to allow customisation
--------------------------------------+------------------------------------
     Reporter:  dfunckt               |                    Owner:  dfunckt
         Type:  Cleanup/optimization  |                   Status:  assigned
    Component:  contrib.auth          |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  1
  Needs tests:  1                     |  Patch needs improvement:  0
Easy pickings:  1                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by dfunckt):

 Hi Tim, if by "document" you mean "public API" then it depends on whether
 these mixins are intended to be extended. There's no reason one would call
 the method unless wanting to customise the mixin somehow and
 `UserPassesTestMixin` isn't enough. Apart from checking for object
 permissions, I can't think of other reasons to extend though, and that
 includes my experience with the respective function decorators -- access
 customisation is usually done with auth backends.

 Regarding tests, the only meaningful test for these changes I guess would
 be to test that `has_permission` raises an exception if not provided.

--
Ticket URL: <https://code.djangoproject.com/ticket/25142#comment:10>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.7bc8e7ba8c0c55207ccd9f5fe0762ffc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to