Jürgen Hoffmann wrote:

 So the question really is, how do you update the user? Through
 RunData.getUser().set...()?

For better or worse, I learned Turbine/Torque by reading code from another project by another developer. It operated directly upon the TurbineUser object by means of the following method:

   public static TurbineUser getTurbineUser(RunData data) {
return (TurbineUser)((TorqueUser)(data.getUser())).getPersistentObj();
   }

Based on my experience, I get the feeling that there's something better, but I don't know what that is, so I've stuck with the status quo.

How do other people do this sort of thing? I can imagine using RunData.getUser().getPerm/setPerm instead, although our current design allows us to use foreign keys to build relationships between TurbineUser and other tables/objects, whereas I don't think getPerm/setPerm would do the same.

 as you see, the object in the db will always be overwritten with the
 user that is stored inside the session.

Yep, that's what's happening. Your sample code comes from the LogoutUser action, which defers to TurbineSecurity.saveUser, which defers to TurbineSecurityService.saveUser, which defers to TorqueUserManager.store. As a consequence of that, I can also provide my own user manager that does something different for TorqueUserManager.store (e.g. make *that* a no-op), except I don't know what else will break if I do that. :)

 I have implemented something, that only allowed one user to be logged
 in at a given time. If another user logs the second time, the first
 user is logged out automatically. If you are interested I can
 provide the source.

Actually, I would like to see that code, if it's not a bother... Thanks again!

Shane

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to