class documentation

class ModelBackend(BaseBackend):

Known subclasses: django.contrib.auth.backends.AllowAllUsersModelBackend, django.contrib.auth.backends.RemoteUserBackend

View In Hierarchy

Authenticates against settings.AUTH_USER_MODEL.
Method authenticate Undocumented
Method get​_all​_permissions Undocumented
Method get​_group​_permissions Return a set of permission strings the user user_obj has from the groups they belong.
Method get​_user​_permissions Return a set of permission strings the user user_obj has from their user_permissions.
Method has​_module​_perms Return True if user_obj has any permissions in the given app_label.
Method has​_perm Undocumented
Method user​_can​_authenticate Reject users with is_active=False. Custom user models that don't have that attribute are allowed.
Method with​_perm Return users that have permission "perm". By default, filter out inactive users and include superusers.
Method ​_get​_group​_permissions Undocumented
Method ​_get​_permissions Return the permissions of user_obj from from_name. from_name can be either "group" or "user" to return permissions from _get_group_permissions or _get_user_permissions respectively.
Method ​_get​_user​_permissions Undocumented
Method get​_user Undocumented
def authenticate(self, request, username=None, password=None, **kwargs):
def get_all_permissions(self, user_obj, obj=None):
def get_group_permissions(self, user_obj, obj=None):
Return a set of permission strings the user user_obj has from the groups they belong.
def get_user_permissions(self, user_obj, obj=None):
Return a set of permission strings the user user_obj has from their user_permissions.
def has_module_perms(self, user_obj, app_label):
Return True if user_obj has any permissions in the given app_label.
def has_perm(self, user_obj, perm, obj=None):
def user_can_authenticate(self, user):
Reject users with is_active=False. Custom user models that don't have that attribute are allowed.
def with_perm(self, perm, is_active=True, include_superusers=True, obj=None):
Return users that have permission "perm". By default, filter out inactive users and include superusers.
def _get_group_permissions(self, user_obj):

Undocumented

def _get_permissions(self, user_obj, obj, from_name):
Return the permissions of user_obj from from_name. from_name can be either "group" or "user" to return permissions from _get_group_permissions or _get_user_permissions respectively.
def _get_user_permissions(self, user_obj):

Undocumented

def get_user(self, user_id):