Changeset 1302
- Timestamp:
- 11/20/05 10:35:44 (3 years ago)
- Files:
-
- django/trunk/docs/authentication.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/authentication.txt
r1221 r1302 50 50 * ``is_staff`` -- Boolean. Designates whether this user can access the 51 51 admin site. 52 * ``is_active`` -- Boolean. Designates whether this user account is valid.53 Set this to ``False`` instead of deleting accounts.54 * ``is_superuser`` -- Boolean. Designates whether this user has permission55 to do anything (according to the permission system).52 * ``is_active`` -- Boolean. Designates whether this user can log into the 53 Django admin. Set this to ``False`` instead of deleting accounts. 54 * ``is_superuser`` -- Boolean. Designates that this user has all permissions 55 without explicitly assigning them. 56 56 * ``last_login`` -- A datetime of the user's last login. Is set to the 57 57 current date/time by default. … … 94 94 95 95 * ``has_perm(perm)`` -- Returns ``True`` if the user has the specified 96 permission .96 permission, where perm is in the format ``"package.codename"``. 97 97 98 98 * ``has_perms(perm_list)`` -- Returns ``True`` if the user has each of the 99 specified permissions. 99 specified permissions, where each perm is in the format 100 ``"package.codename"``. 100 101 101 102 * ``has_module_perms(package_name)`` -- Returns ``True`` if the user has … … 272 273 273 274 As a shortcut, you can use the convenient ``user_passes_test`` decorator:: 275 276 from django.views.decorators.auth import user_passes_test 277 278 def my_view(request): 279 # ... 280 my_view = user_passes_test(my_view, lambda u: u.has_perm('polls.can_vote')) 281 282 Here's the same thing, using Python 2.4's decorator syntax:: 274 283 275 284 from django.views.decorators.auth import user_passes_test
