Add base authentication backend to ease custom backend creation.
Currently, writing a new authentication backend requires quite some boilerplate e.g. has_perm()
can be derived from get_all_permissions()
which in turn can be derived from get_user_permissions()
and get_group_permissions()
. Additionally, authenticate()
and get_user()
should always return None
for backends that only handle permissions.
Also note that get_all_permissions()
and get_group_permissions()
exist on the User model, but get_user_permissions()
does not. I think this is confusing for backend authors.
Mailinglist thread: https://groups.google.com/forum/#!topic/django-developers/CNmz22gEsCc
Pull request: https://github.com/django/django/pull/11037
Change History
(10)
Needs tests: |
set
|
Summary: |
Simplify authentication backend interface → Add base authentication backend to ease custom backend creation.
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Cleanup/optimization → New feature
|
Version: |
2.1 → master
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Description: |
modified (diff)
|
Triage Stage: |
Accepted → Ready for checkin
|
Patch needs improvement: |
set
|
Triage Stage: |
Ready for checkin → Accepted
|
Patch needs improvement: |
unset
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
I left a few comments on the PR. When they're addressed, good to go.