[xwiki-devs] XWikiDocument#get/setUser/Creator/ContentAuthorReference() and guest
Hi devs, Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic. As a reminder here it is: not logged in user (guest) reference is null. Plain and simple. The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases. It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there. 5.0 and new right service is a good occasion for this improvement. WDYT ? Here is my +1 -- Thomas Mortagne
On 03/21/2013 01:13 PM, Thomas Mortagne wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1
+1 as well. I tried to refactor that code a couple of times, but I got into some problems with backwards compatibility so I dropped it. If we decide that we want to change the behavior, go for it. -- Sergiu Dumitriu http://purl.org/net/sergiu
+1, a very good time to get back on track However, I have currently protected the XWikiCachingRightService from those issues, we could simplify it later if wanted. On Thu, Mar 21, 2013 at 6:17 PM, Sergiu Dumitriu <[email protected]> wrote:
On 03/21/2013 01:13 PM, Thomas Mortagne wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1
+1 as well. I tried to refactor that code a couple of times, but I got into some problems with backwards compatibility so I dropped it. If we decide that we want to change the behavior, go for it.
-- Sergiu Dumitriu http://purl.org/net/sergiu _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO
+1 Thanks, Marius On Thu, Mar 21, 2013 at 7:13 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1 -- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Note that the require refactoring would make impossible to have empty user in a document anymore since getAuthor() would return XWikiGuest in that case. On Thu, Mar 21, 2013 at 6:13 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1 -- Thomas Mortagne
-- Thomas Mortagne
Four +1 and nobody against it. Done. Between that, the new security system by default and the current state of http://ci.xwiki.org looks like I will enjoy being the release manager of 4.0.x :D On Thu, Mar 21, 2013 at 6:13 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1 -- Thomas Mortagne
-- Thomas Mortagne
On Sun, Mar 24, 2013 at 5:50 PM, Thomas Mortagne <[email protected]> wrote:
Four +1 and nobody against it. Done.
Between that, the new security system by default and the current state of http://ci.xwiki.org looks like I will enjoy being the release manager of 4.0.x :D
Meant 5.0.x of course (even if I was release manager for 4.0.x) ;)
On Thu, Mar 21, 2013 at 6:13 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1 -- Thomas Mortagne
-- Thomas Mortagne
-- Thomas Mortagne
On Mar 24, 2013, at 6:21 PM, Thomas Mortagne <[email protected]> wrote:
On Sun, Mar 24, 2013 at 5:50 PM, Thomas Mortagne <[email protected]> wrote:
Four +1 and nobody against it. Done.
Between that, the new security system by default and the current state of http://ci.xwiki.org looks like I will enjoy being the release manager of 4.0.x :D
Meant 5.0.x of course (even if I was release manager for 4.0.x) ;)
:) Speaking of which, today is release day for 5.0M2… Thanks -Vincent
On Thu, Mar 21, 2013 at 6:13 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
Following http://markmail.org/message/snnlesexie4ox3i5 I would like to modify user related methods in XWikiDocument to behave like the what has been voted for XWikiContext and follow the same logic.
As a reminder here it is: not logged in user (guest) reference is null. Plain and simple.
The idea would be to do exactly the same thing than XWikiContext meaning that old String APIs continue to deal with "XWikiGuest" and do convertions for retro compatibility especially with existing databases.
It will change the behavior of XWikiDocument#getUserReference() from external point of view so it's a breakage but we might actually fix more bugs than we create when thinking about codes like context.setUserRefererence(document.getAuthorReference()) or $context.userReference == $doc.authorReference which I'm sure we can find here and there.
5.0 and new right service is a good occasion for this improvement.
WDYT ?
Here is my +1
participants (5)
-
Denis Gervalle -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol