User.currentUser and Admin "pretending" to be another user for testing

19 views
Skip to first unread message

Andrzej Skalski

unread,
Apr 21, 2015, 1:08:21 PM4/21/15
to lif...@googlegroups.com
Hi,

I have seen once in a big web application a capability for superusers to pretend to be some other user, to see the application from someone else's perspective. That was helpful for debugging.

I was wondering - if I just override User.currentUser with some wrapper, providing someone else's profile for testing - what would mess up? I mean after all I want the superuser to remain logged in, and just the views and snippets compute as someone else was.

Any ideas?

Kindest Regards
Andrzej Skalski

Christoph Knabe

unread,
Apr 24, 2015, 4:18:52 PM4/24/15
to lif...@googlegroups.com
Hello Andrzej,

this feature is very useful, because sometimes users complain, that they cannot access a specific function.
So logging in with the Admin password but another username gives the admin the chance to reproduce the error. Just today I had such a case.

But it was quite a lot of work. I can't say how to do it with minimal effort, as I rewrote nearly all related to user authentication in order to use Container Managed Security with an own LoginModule. OTOH it is really feasible. The concerning code is among others in https://www.assembla.com/code/lehrkraftnews/git/nodes/master/LiftLehrkraftnews/src/main/scala/com/lehrkraftnews/model/User.scala

Best wishes,

Christoph


Reply all
Reply to author
Forward
0 new messages