summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-12-21 19:18:12 +0000
committerJannis Leidel <jannis@leidel.info>2010-12-21 19:18:12 +0000
commit745c255a19df498d328b908fc3df326cdf0cf638 (patch)
treed6da7081dbb552d98a0f05c98baeba9348531a67 /docs
parent5830477e467482edcdee7e9e65feed8c98dd0bc2 (diff)
Fixed #14249 -- Added support for inactive users to the auth backend system. Thanks, Harro van der Klauw.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15010 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/internals/deprecation.txt8
-rw-r--r--docs/releases/1.3-beta-1.txt8
-rw-r--r--docs/releases/1.3.txt8
-rw-r--r--docs/topics/auth.txt27
4 files changed, 50 insertions, 1 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 4cd4807188..54f40d027a 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -98,6 +98,9 @@ their deprecation, as per the :ref:`Django deprecation policy
* The ``no`` language code has been deprecated in favor of the ``nb``
language code.
+ * Authentication backends need to define the boolean attribute
+ ``supports_inactive_user``.
+
* 1.5
* The ``mod_python`` request handler has been deprecated since the 1.3
release. The ``mod_wsgi`` handler should be used instead.
@@ -139,6 +142,11 @@ their deprecation, as per the :ref:`Django deprecation policy
* The :djadmin:`reset` and :djadmin:`sqlreset` management commands
are deprecated.
+ * Authentication backends need to support a inactive user
+ being passed to all methods dealing with permissions.
+ The ``supports_inactive_user`` variable is not checked any
+ longer and can be removed.
+
* 2.0
* ``django.views.defaults.shortcut()``. This function has been moved
to ``django.contrib.contenttypes.views.shortcut()`` as part of the
diff --git a/docs/releases/1.3-beta-1.txt b/docs/releases/1.3-beta-1.txt
index 1fa6bf2e44..342136cd2f 100644
--- a/docs/releases/1.3-beta-1.txt
+++ b/docs/releases/1.3-beta-1.txt
@@ -55,6 +55,14 @@ displayed by most translation tools.
For more information, see :ref:`translator-comments`.
+Permissions for inactive users
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you provide a custom auth backend with ``supports_inactive_user`` set to
+``True``, an inactive user model will check the backend for permissions.
+This is useful for further centralizing the permission handling. See the
+:ref:`authentication docs <topics-auth>` for more details.
+
Backwards-incompatible changes in 1.3 alpha 2
=============================================
diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt
index d111eaeffb..bd68f02aad 100644
--- a/docs/releases/1.3.txt
+++ b/docs/releases/1.3.txt
@@ -177,6 +177,14 @@ caching in Django<topics/cache>`.
.. _pylibmc: http://sendapatch.se/projects/pylibmc/
+Permissions for inactive users
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you provide a custom auth backend with ``supports_inactive_user`` set to
+``True``, an inactive user model will check the backend for permissions.
+This is useful for further centralizing the permission handling. See the
+:ref:`authentication docs <topics-auth>` for more details.
+
Everything else
~~~~~~~~~~~~~~~
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
index 04b6d39964..641db3a8b2 100644
--- a/docs/topics/auth.txt
+++ b/docs/topics/auth.txt
@@ -741,7 +741,7 @@ The login_required decorator
@login_required
def my_view(request):
...
-
+
:func:`~django.contrib.auth.decorators.login_required` does the following:
* If the user isn't logged in, redirect to
@@ -1645,6 +1645,31 @@ loudly. Additionally ``supports_anonymous_user`` will be set to ``False``.
Django 1.4 will assume that every backend supports anonymous users being
passed to the authorization methods.
+Authorization for inactive users
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. versionadded:: 1.3
+
+An inactive user is a one that is authenticated but has its attribute
+``is_active`` set to ``False``. However this does not mean they are not
+authrozied to do anything. For example they are allowed to activate their
+account.
+
+The support for anonymous users in the permission system allows for
+anonymous users to have permissions to do something while inactive
+authenticated users do not.
+
+To enable this on your own backend, you must set the class attribute
+``supports_inactive_user`` to ``True``.
+
+A nonexisting ``supports_inactive_user`` attribute will raise a
+``PendingDeprecationWarning`` if used in Django 1.3. In Django 1.4, this
+warning will be updated to a ``DeprecationWarning`` which will be displayed
+loudly. Additionally ``supports_inactive_user`` will be set to ``False``.
+Django 1.5 will assume that every backend supports inactive users being
+passed to the authorization methods.
+
+
Handling object permissions
---------------------------