views:

58

answers:

2

Is it possible to implement an equivalent of sudo for Django profiles ? I'm using the basic authentication system django.contrib.auth.

Usecase: Sometimes, users report bugs which are only reproductible in their profile, so, each time, I change their password, log in, fix the bug and replaces the password with the original one.

I tried to implement this feature by using login() but it requires a call to authenticate() in the first place which is not an option because we don't have the password in clear text, just the hashed one.

Is there any clever way to do that? Except messing up with the user's password?

Thanks!

+2  A: 

Djangosnippets.org is your friend: http://www.djangosnippets.org/snippets/1590/

stevejalim
A: 

I knocked up a user panel in the debug toolbar. It works well for flipping logged in users around . The fork is here.

http://github.com/mjbrownie/django-debug-toolbar

it also displays some basic user group permission info. I didn't get around to expanding it.

you could borrow the logic so it doesn't have to run in debug mode.

michael