#10809: mod_wsgi authentication handler
---------------------------------------------+------------------------------
          Reporter:  baumer1122              |         Owner:  davidfischer
            Status:  assigned                |     Milestone:              
         Component:  Authentication          |       Version:  SVN         
        Resolution:                          |      Keywords:  mod_wsgi    
             Stage:  Design decision needed  |     Has_patch:  1           
        Needs_docs:  0                       |   Needs_tests:  0           
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by davidfischer):

 Implementing the `groups_for_user()` function in the same handler file is
 probably a good idea. However, instead of checking the permissions as on
 the mailing list, I think it's a good idea to return a list of Django
 groups for that particular user. Perhaps something along the line of:
 {{{
 from django.contrib.auth.models import User, AnonymousUser

 def groups_for_user(environ, username):
     try:
         user = User.objects.get(username=username)
     except User.DoesNotExist:
         user = AnonymousUser()

     return [g.name for g in user.groups.all()]
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10809#comment:16>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to