Ticket #9414: 9414.diff

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

clarify has_perm arguments permissions

  • docs/topics/auth.txt

     
    212212    .. method:: models.User.has_perm(perm)
    213213
    214214        Returns ``True`` if the user has the specified permission, where perm is
    215         in the format ``"<application name>.<lowercased model name>"``. If the
    216         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``.
    217217
    218218    .. method:: models.User.has_perms(perm_list)
    219219
    220220        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``.
    223224
    224225    .. method:: models.User.has_module_perms(package_name)
    225226
     
    10601061        my_view = permission_required('polls.can_vote')(my_view)
    10611062
    10621063    As for the :meth:`User.has_perm` method, permission names take the form
    1063     ``"<application name>.<lowercased model name>"`` (i.e. ``polls.choice`` for
    1064     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).
    10651066
    10661067    Note that :func:`~django.contrib.auth.decorators.permission_required()`
    10671068    also takes an optional ``login_url`` parameter. Example::
Back to Top