Gopal Ramasammy-Cook wrote:
> > TurbineUser user = TurbineSecurity.getAnonymousUser();
> > user.setLoginName("collie");
> > user.setFirstName("colin");
> > TurbineSercurity.addUser(user, "password");
>
> Now I am a bit confused. I thought TurbineSecurity was a facade class to hide the
>actual security implementation, which is based on the User interface (and not the
>TurbineUser class) ie. code that users the security implementation should not know
>that TurbineUser actually implements the User interface.
>
> Thus, I would have thought that the correct code for the above is as follows:
>
> User user = TurbineSecurity.getAnonymousUser();
> user.setLoginName("collie");
> user.setFirstName("colin");
> TurbineSercurity.addUser(user, "password");
>
> Am I missing something?
You are right, in general case. However, if your application defines a
custom
User class, that has covenience methods wrapping around setPerm/getPerm
you migtht prefer to use your class directly:
CustomUser user = (CustomUser)TurbineSecrity.getAnonymousUser();
I hope we have this right *this* time :-)
Rafal
--
Rafal Krzewski
Senior Internet Developer
mailto:[EMAIL PROTECTED]
+48 22 8534830 http://e-point.pl
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]