Code

Ticket #9414: 9414.diff

File 9414.diff, 1.7 KB (added by timo, 5 years ago)

clarify has_perm arguments permissions

Line 
1Index: docs/topics/auth.txt
2===================================================================
3--- docs/topics/auth.txt        (revision 11543)
4+++ docs/topics/auth.txt        (working copy)
5@@ -212,14 +212,15 @@
6     .. method:: models.User.has_perm(perm)
7 
8         Returns ``True`` if the user has the specified permission, where perm is
9-        in the format ``"<application name>.<lowercased model name>"``. If the
10-        user is inactive, this method will always return ``False``.
11+        in the format ``"<app label>.<permission codename>"``.
12+        If the user is inactive, this method will always return ``False``.
13 
14     .. method:: models.User.has_perms(perm_list)
15 
16         Returns ``True`` if the user has each of the specified permissions,
17-        where each perm is in the format ``"package.codename"``. If the user is
18-        inactive, this method will always return ``False``.
19+        where each perm is in the format
20+        ``"<app label>.<permission codename>"``. If the user is inactive,
21+        this method will always return ``False``.
22 
23     .. method:: models.User.has_module_perms(package_name)
24 
25@@ -1060,8 +1061,8 @@
26         my_view = permission_required('polls.can_vote')(my_view)
27 
28     As for the :meth:`User.has_perm` method, permission names take the form
29-    ``"<application name>.<lowercased model name>"`` (i.e. ``polls.choice`` for
30-    a ``Choice`` model in the ``polls`` application).
31+    ``"<app label>.<permission codename>"`` (i.e. ``polls.can_vote`` for a
32+    permission on a model in the ``polls`` application).
33 
34     Note that :func:`~django.contrib.auth.decorators.permission_required()`
35     also takes an optional ``login_url`` parameter. Example::