Author: russellm
Date: 2009-09-12 20:13:40 -0500 (Sat, 12 Sep 2009)
New Revision: 11547
Modified:
django/trunk/docs/topics/auth.txt
Log:
Fixed #9414 -- Clarified the documentation on the permission decorators. Thanks
to timo for the patch.
Modified: django/trunk/docs/topics/auth.txt
===================================================================
--- django/trunk/docs/topics/auth.txt 2009-09-13 00:25:53 UTC (rev 11546)
+++ django/trunk/docs/topics/auth.txt 2009-09-13 01:13:40 UTC (rev 11547)
@@ -212,14 +212,15 @@
.. method:: models.User.has_perm(perm)
Returns ``True`` if the user has the specified permission, where perm
is
- in the format ``"<application name>.<lowercased model name>"``. If the
- user is inactive, this method will always return ``False``.
+ in the format ``"<app label>.<permission codename>"``.
+ 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
+ ``"<app label>.<permission codename>"``. If the user is inactive,
+ this method will always return ``False``.
.. method:: models.User.has_module_perms(package_name)
@@ -1062,8 +1063,8 @@
my_view = permission_required('polls.can_vote')(my_view)
As for the :meth:`User.has_perm` method, permission names take the form
- ``"<application name>.<lowercased model name>"`` (i.e. ``polls.choice`` for
- a ``Choice`` model in the ``polls`` application).
+ ``"<app label>.<permission codename>"`` (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::
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---