Skip to content

Commit

Permalink
Doc'd PermissionsMixin's usage of User.is_active and is_superuser.
Browse files Browse the repository at this point in the history
  • Loading branch information
xi authored and timgraham committed Nov 12, 2018
1 parent d486621 commit b1243a5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/topics/auth/customizing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -919,8 +919,9 @@ methods and attributes:

Returns ``True`` if the user has the specified permission, where
``perm`` is in the format ``"<app label>.<permission codename>"`` (see
:ref:`permissions <topic-authorization>`). If the user is inactive, this method will
always return ``False``.
:ref:`permissions <topic-authorization>`). If :attr:`.User.is_active`
and :attr:`~.User.is_superuser` are both ``True``, this method always
returns ``True``.

If ``obj`` is passed in, this method won't check for a permission for
the model, but for this specific object.
Expand All @@ -929,17 +930,19 @@ methods and attributes:

Returns ``True`` if the user has each of the specified permissions,
where each perm is in the format
``"<app label>.<permission codename>"``. If the user is inactive,
this method will always return ``False``.
``"<app label>.<permission codename>"``. If :attr:`.User.is_active` and
:attr:`~.User.is_superuser` are both ``True``, this method always
returns ``True``.

If ``obj`` is passed in, this method won't check for permissions for
the model, but for the specific object.

.. method:: models.PermissionsMixin.has_module_perms(package_name)

Returns ``True`` if the user has any permissions in the given package
(the Django app label). If the user is inactive, this method will
always return ``False``.
(the Django app label). If :attr:`.User.is_active` and
:attr:`~.User.is_superuser` are both ``True``, this method always
returns ``True``.

.. admonition:: ``PermissionsMixin`` and ``ModelBackend``

Expand Down

0 comments on commit b1243a5

Please sign in to comment.