reviewboard.accounts.backends.standard¶
Standard authentication backend.
-
class
StandardAuthBackend
[source]¶ Bases:
reviewboard.accounts.backends.base.BaseAuthBackend
,django.contrib.auth.backends.ModelBackend
Authenticate users against the local database.
This will authenticate a user against their entry in the database, if the user has a local password stored. This is the default form of authentication in Review Board.
This backend also handles permission checking for users on LocalSites. In Django, this is the responsibility of at least one auth backend in the list of configured backends.
Regardless of the specific type of authentication chosen for the installation, StandardAuthBackend will always be provided in the list of configured backends. Because of this, it will always be able to handle authentication against locally added users and handle LocalSite-based permissions for all configurations.
-
settings_form
[source]¶ alias of
reviewboard.accounts.forms.auth.StandardAuthSettingsForm
-
authenticate
(username, password, **kwargs)[source]¶ Authenticate the user.
This will authenticate the username and return the appropriate User object, or None.
-
get_or_create_user
(username, request)[source]¶ Get an existing user, or create one if it does not exist.
-
get_all_permissions
(user, obj=None)[source]¶ Get a list of all permissions for a user.
If a LocalSite instance is passed as
obj
, then the permissions returned will be those that the user has on that LocalSite. Otherwise, they will be their global permissions.It is not legal to pass any other object.
-
has_perm
(user, perm, obj=None)[source]¶ Get whether or not a user has the given permission.
If a LocalSite instance is passed as
obj
, then the permissions checked will be those that the user has on that LocalSite. Otherwise, they will be their global permissions.It is not legal to pass any other object.
-