What's the use case that requires you to need the username?

The reason we blocked access to that field is for security reasons. The account username/password fields should be known only to their user and only be used for authentication. For everything else we should be using other fields IMO.

If you need something that uniquely identifies the user then we should use either the userId (user.getId()), which is used by the data store, or add some kind of other public version of the userId which is meant for sharing.

-- Allen


Dave wrote:
Roller allows you to have both a 'username' and a 'screenname'. Your
username must be unique and can never change. Your sceenname doesn't
have to be unique and can change. That's all good (perhaps I would
have called the unique one 'userid' and the changing one 'username' if
I had to do it all again, but no matter).

In Roller page templates, when you access the $user.username property,
you actually get the sceenname back, which is the right thing for most
cases because that's what we want to display. That's all good too, but
there are cases where you need access to the unique username
identifier.

Any objection to adding a way to access username in the UserWrapper object?

And, what should the method be called? Should it be:
   UserWrapper.getUserId()

Or:
   UserWrapper.getUserNameRaw()

Or something else. I like the first option.

- Dave

Reply via email to