[xwiki-devs] XWikiContext#getUser and not logged in users

Thomas Mortagne thomas.mortagne at xwiki.com
Fri Mar 25 13:19:17 UTC 2011


Hi devs,

I'm currently working on http://jira.xwiki.org/jira/browse/XWIKI-6103
which has two aspects:

1) stored the user as a DocumentReference in the context so that we
stop loosing the user all the time when switching databases
2) provide a DocumentReference oriented API to deal with the current user

For 2 I would like to propose some change in the way to see not logged
in user: I would like to make getUserReference return null when there
is no user logged in instead of some DocumentReference containing
<currentwiki>:XWiki.XWikiGuest. I understand that when dealing with
string "XWikiGuest" hack appear but null when there is actually no
context user makes much more sense at Java level IMO. Make safer to
distinguish between no logged in user and logged in user and you don't
really care what has been chosen as virtual name for not logged in
users at this level.

That will not impact anything which already exist and is just for code
that will use the new API of course but I think it deserve some debate
first since that's another way to see things and well it's an API.

WDYT ?

-- 
Thomas Mortagne



More information about the devs mailing list