Django

Code

Show
Ignore:
Timestamp:
03/12/08 01:42:09 (10 months ago)
Author:
gwilson
Message:

Fixed #6753 -- Corrected typo in authentication docs, thanks piem@piem.org and PJCrosier.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/authentication.txt

    r6924 r7229  
    8484 
    8585    myuser.groups = [group_list] 
    86     myuser.groups.add(group, group,...) 
    87     myuser.groups.remove(group, group,...) 
     86    myuser.groups.add(group, group, ...) 
     87    myuser.groups.remove(group, group, ...) 
    8888    myuser.groups.clear() 
    8989    myuser.user_permissions = [permission_list] 
    9090    myuser.user_permissions.add(permission, permission, ...) 
    91     myuser.user_permissions.remove(permission, permission, ...] 
     91    myuser.user_permissions.remove(permission, permission, ...) 
    9292    myuser.user_permissions.clear() 
    9393 
     
    381381 
    382382.. admonition:: Calling ``authenticate()`` first 
    383      
     383 
    384384    When you're manually logging a user in, you *must* call 
    385385    ``authenticate()`` before you call ``login()``. ``authenticate()`` 
     
    388388    documentation`_ for details), and this information is needed later 
    389389    during the login process. 
    390      
     390 
    391391.. _backends documentation: #other-authentication-sources 
    392392 
     
    461461In the Django development version, ``login_required`` also takes an optional 
    462462``redirect_field_name`` parameter. Example:: 
    463      
     463 
    464464    from django.contrib.auth.decorators import login_required 
    465465 
     
    469469 
    470470Again, an equivalent example of the more compact decorator syntax introduced in Python 2.4:: 
    471      
     471 
    472472    from django.contrib.auth.decorators import login_required 
    473473 
     
    480480    * If the user isn't logged in, redirect to ``settings.LOGIN_URL`` 
    481481      (``/accounts/login/`` by default), passing the current absolute URL 
    482       in the query string as ``next`` or the value of ``redirect_field_name``.  
     482      in the query string as ``next`` or the value of ``redirect_field_name``. 
    483483      For example: 
    484484      ``/accounts/login/?next=/polls/3/``. 
     
    11201120----------------------------------------- 
    11211121 
    1122 Custom auth backends can provide their own permissions.  
     1122Custom auth backends can provide their own permissions. 
    11231123 
    11241124The user model will delegate permission lookup functions 
     
    11331133The simple backend above could implement permissions for the magic admin fairly 
    11341134simply:: 
    1135          
     1135 
    11361136    class SettingsBackend: 
    1137      
     1137 
    11381138        # ... 
    11391139 
     
    11431143            else: 
    11441144                return False 
    1145                  
     1145 
    11461146This gives full permissions to the user granted access in the above example. Notice 
    11471147that the backend auth functions all take the user object as an argument, and