From 75337a60509fdfdd321a5caf8e30d57fff6b9518 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Fri, 8 Mar 2019 17:48:50 +0100 Subject: Fixed #30226 -- Added BaseBackend for authentication. --- docs/ref/contrib/auth.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index 12186f19b7..17197e9fc7 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -460,6 +460,27 @@ Available authentication backends The following backends are available in :mod:`django.contrib.auth.backends`: +.. class:: BaseBackend + + .. versionadded:: 3.0 + + A base class that provides default implementations for all required + methods. By default, it will reject any user and provide no permissions. + + .. method:: get_group_permissions(user_obj, obj=None) + + Returns an empty set. + + .. method:: get_all_permissions(user_obj, obj=None) + + Uses :meth:`get_group_permissions` to get the set of permission strings + the ``user_obj`` has. + + .. method:: has_perm(user_obj, perm, obj=None) + + Uses :meth:`get_all_permissions` to check if ``user_obj`` has the + permission string ``perm``. + .. class:: ModelBackend This is the default authentication backend used by Django. It -- cgit v1.3