From 05c087300c4bf3c16591d115f75a48bd97ddc888 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sun, 13 Sep 2009 06:33:09 +0000 Subject: [PATCH] [1.1.X] Fixed #9414 -- Clarified the documentation on the permission decorators. Thanks to timo for the patch. Merge of r11547 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11569 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/topics/auth.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt index 40243cca8c..6a62be8c32 100644 --- a/docs/topics/auth.txt +++ b/docs/topics/auth.txt @@ -212,14 +212,15 @@ Methods .. method:: models.User.has_perm(perm) Returns ``True`` if the user has the specified permission, where perm is - in the format ``"."``. If the - user is inactive, this method will always return ``False``. + in the format ``"."``. + If the user is inactive, this method will always return ``False``. .. method:: models.User.has_perms(perm_list) Returns ``True`` if the user has each of the specified permissions, - where each perm is in the format ``"package.codename"``. If the user is - inactive, this method will always return ``False``. + where each perm is in the format + ``"."``. If the user is inactive, + this method will always return ``False``. .. method:: models.User.has_module_perms(package_name) @@ -1062,8 +1063,8 @@ The permission_required decorator my_view = permission_required('polls.can_vote')(my_view) As for the :meth:`User.has_perm` method, permission names take the form - ``"."`` (i.e. ``polls.choice`` for - a ``Choice`` model in the ``polls`` application). + ``"."`` (i.e. ``polls.can_vote`` for a + permission on a model in the ``polls`` application). Note that :func:`~django.contrib.auth.decorators.permission_required()` also takes an optional ``login_url`` parameter. Example::