Re: [xwiki-devs] [xwiki-notifications] r33933 - platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api
On Jan 13, 2011, at 1:10 AM, cjdelisle (SVN) wrote:
Author: cjdelisle Date: 2011-01-13 01:10:03 +0100 (Thu, 13 Jan 2011) New Revision: 33933
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java Log: XWIKI-5881: Incorrect javadoc for c.x.x.api.Context#dropPermissions()
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java =================================================================== --- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java 2011-01-12 18:47:41 UTC (rev 33932) +++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Context.java 2011-01-13 00:10:03 UTC (rev 33933) @@ -570,8 +570,21 @@ }
/** - * Drop all author permissions by switching author to guest. - * Call this when all code requiring permission has been executed and the code following may be untrusted. + * After this is called: + * 1. {@link com.xpn.xwiki.api.Api#hasProgrammingRights()} will always return false. + * 2. {@link com.xpn.xwiki.api.XWiki#getDocumentAsAuthor(org.xwiki.model.reference.DocumentReference)}, + * {@link com.xpn.xwiki.api.XWiki#getDocumentAsAuthor(String)}, + * {@link com.xpn.xwiki.api.Document#saveAsAuthor()}, + * {@link com.xpn.xwiki.api.Document#saveAsAuthor(String)}, + * {@link com.xpn.xwiki.api.Document#saveAsAuthor(String, boolean)}, + * and {@link com.xpn.xwiki.api.Document#deleteAsAuthor()} will all to their actions as if the author + * was the guest user (XWiki.XWikiGuest).
typo: "... will all to their actions..." ? "will all perform their actions as if..." instead?
+ * + * In effect, no code requiring "programming right" will run, and if the document content author + * (see: {@link com.xpn.xwiki.api.Document#getContentAuthor()}) is a user who has "programming right", + * there will be no way for code following this call to save another document as this user, blessing + * it too with programming right. + * * Once dropped, permissions cannot be regained for the duration of the request. * * @since 2.5M2
Thanks -Vincent
participants (1)
-
Vincent Massol