Sorry, I didn't change the subject on the last email, should have been
this one then. If you don't know what I am talking about, please read
the last email.
(http://groups.google.com/group/django-developers/msg/50f9393fa15251b3?hl=en)

I have starting rewriting the auth-system now (""), code can be viewed
at https://svn.webmasterpro.de/django-auth-rewrite/. This branch moves
django.contrib.auth to django.contrib.oldauth and creates
django.contrib.auth which includes oldauth. django.contrib.newauth is
added with my code, but not used by default so far.

I tried to use the old function-names where possible, as you can see in
https://svn.webmasterpro.de/django-auth-rewrite/django/contrib/newauth/__init__.py.
I added some new functions:
 * get_user_model: retrieve the model for foreign keys
 * foo_redirect: redirect to the login-page (no configuration needed
this way)
 * get_anonymous_user: get the anonymous user, which can be saved into
the database this way (so anonymous comments can include a user_id and
permissions can be set for guests)
 * is_authenticated: test if a user is authenticated
 * has_model_permission: test if a user may access a model (like done in
the old system)
 * has_object_permission: test if a user may access an onject (like done
in generic-auth)

Most of the functions are only wrappers for functions used in some
auth-system later. The modules which are used can be set using
settings.AUTHENTICATION_MODULE and settings.AUTHORIZATION_MODULE (which
is not in the default-config as no implementation exists in this branch).
has_xxx_permissions can do anything they want. No database access is
required, but Django may ship some row-level-permission-system to set
using AUTHORIZATION_MODULE.
context_processors are included, but don't do much right now
(https://svn.webmasterpro.de/django-auth-rewrite/django/contrib/newauth/context_processors.py).
The middleware is a copy of the old middleware so far, but changes the
import-statement
(https://svn.webmasterpro.de/django-auth-rewrite/django/contrib/newauth/middleware.py).
I included some decorators here, that can be used, see __doc__-strings
for details
(https://svn.webmasterpro.de/django-auth-rewrite/django/contrib/newauth/decorators.py).
The models-file only loads the user-model into the local var "User" to
get imports fixed
(https://svn.webmasterpro.de/django-auth-rewrite/django/contrib/newauth/models.py).

Currently there exists no implementation of a user-system or
authorization-checks, besided in my project (I implemented this for a
CMS I'm writing). So the code in newauth is not able to do something
fancy, but should clarify what I ment in the last email. The models from
oldauth should be easy to convert (but I would skip the backends and put
this into a different application), but I don't have enough time today.
Of course the admin is not working, too.

Hope to whet your appetite and get some comments this time.

I know I don't follow your coding-style here, but I'm willing to change
that if I get some positive response on this.

Greetings, David Danier

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to