#13933: add ModelBackend inheritence to custom auth backend doc to enable
Permissions
---------------------------------------------+------------------------------
          Reporter:  mbg                     |         Owner:  nobody
            Status:  reopened                |     Milestone:        
         Component:  Documentation           |       Version:  1.2   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  0     
        Needs_docs:  0                       |   Needs_tests:  0     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by ramiro):

  * stage:  Unreviewed => Design decision needed

Comment:

 Replying to [ticket:13933 mbg]:
 > On http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-
 authentication-backend please consider adding some text describing how and
 when one might want to inherit ModelBackend in a custom authorization
 backend. Without ModelBackend the User Permissions are not set as expected
 from configuration seen in .../admin/auth/user/, e.g.
 get_all_permissions() returns [] unless ModelBackend is inherited or the
 code rolls its own Permissions.

 I think that is precisely what the 'Handling authorization in custom
 backend' section in that document says: The custom backend needs to
 implement its own custom authorization policies by implementing the
 `get_group_permissions()`, `get_all_permissions()`, `has_perm()` and
 `has_module_perms()` methods.

 (Granted, unfortunately there is a nomenclature gray area here because
 what Django calls authentication backends [both built-in and external]
 handle in reality both authentication and authorization.)

 IIRC one of the design guidelines followed when creating this pluggable
 backends machinery was to allow the use of classical Python techniques
 like duck typing instead of inheritance and this is the idea is conveyed
 by the text of the document. Adding an example using inheritance wouldn't
 be consistent with this philosophy.

 Leaving ticket open open but moving to DDN.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13933#comment:3>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to