Ticket #9414: 9414.diff
File 9414.diff, 1.7 KB (added by , 15 years ago) |
---|
-
docs/topics/auth.txt
212 212 .. method:: models.User.has_perm(perm) 213 213 214 214 Returns ``True`` if the user has the specified permission, where perm is 215 in the format ``"<app lication name>.<lowercased model name>"``. If the216 user is inactive, this method will always return ``False``.215 in the format ``"<app label>.<permission codename>"``. 216 If the user is inactive, this method will always return ``False``. 217 217 218 218 .. method:: models.User.has_perms(perm_list) 219 219 220 220 Returns ``True`` if the user has each of the specified permissions, 221 where each perm is in the format ``"package.codename"``. If the user is 222 inactive, this method will always return ``False``. 221 where each perm is in the format 222 ``"<app label>.<permission codename>"``. If the user is inactive, 223 this method will always return ``False``. 223 224 224 225 .. method:: models.User.has_module_perms(package_name) 225 226 … … 1060 1061 my_view = permission_required('polls.can_vote')(my_view) 1061 1062 1062 1063 As for the :meth:`User.has_perm` method, permission names take the form 1063 ``"<app lication name>.<lowercased model name>"`` (i.e. ``polls.choice`` for1064 a ``Choice``model in the ``polls`` application).1064 ``"<app label>.<permission codename>"`` (i.e. ``polls.can_vote`` for a 1065 permission on a model in the ``polls`` application). 1065 1066 1066 1067 Note that :func:`~django.contrib.auth.decorators.permission_required()` 1067 1068 also takes an optional ``login_url`` parameter. Example::