Author: sdumitriu Date: 2008-02-26 17:21:35 +0100 (Tue, 26 Feb 2008) New Revision: 7968
Modified: xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/PluginApi.java xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/plugin/PluginApi.java Log: XWIKI-2136: PluginAPI#getPlugin should always require programming rights, and provide an getInternalPlugin methods for in-java usage Updated 1.1 and 1.2 branches to match the trunk Modified: xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/PluginApi.java =================================================================== --- xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/PluginApi.java 2008-02-26 15:50:15 UTC (rev 7967) +++ xwiki-platform/core/branches/xwiki-core-1.1/src/main/java/com/xpn/xwiki/plugin/PluginApi.java 2008-02-26 16:21:35 UTC (rev 7968) @@ -52,13 +52,11 @@ * Return the inner plugin object, if the user has the required programming rights. * * @return The wrapped plugin object. + * @deprecated Use [EMAIL PROTECTED] #getInternalPlugin()} instead. */ public XWikiPluginInterface getPlugin() { - if (hasProgrammingRights()) { - return plugin; - } - return null; + return plugin; } /** @@ -68,14 +66,28 @@ * Programming Rights. * * @return The wrapped plugin object. - * @since 1.3RC1 + * @since 1.1.3 */ - protected XWikiPluginInterface getInternalPlugin() + protected XWikiPluginInterface getProtectedPlugin() { return plugin; } /** + * Return the inner plugin object, if the user has the required programming rights. + * + * @return The wrapped plugin object. + * @since 1.1.3 + */ + public XWikiPluginInterface getInternalPlugin() + { + if (hasProgrammingRights()) { + return plugin; + } + return null; + } + + /** * Set the inner plugin object. * * @param plugin The wrapped plugin object. Modified: xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/plugin/PluginApi.java =================================================================== --- xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/plugin/PluginApi.java 2008-02-26 15:50:15 UTC (rev 7967) +++ xwiki-platform/core/branches/xwiki-core-1.2/xwiki-core/src/main/java/com/xpn/xwiki/plugin/PluginApi.java 2008-02-26 16:21:35 UTC (rev 7968) @@ -52,13 +52,11 @@ * Return the inner plugin object, if the user has the required programming rights. * * @return The wrapped plugin object. + * @deprecated Use [EMAIL PROTECTED] #getInternalPlugin()} instead. */ public XWikiPluginInterface getPlugin() { - if (hasProgrammingRights()) { - return plugin; - } - return null; + return plugin; } /** @@ -68,14 +66,28 @@ * Programming Rights. * * @return The wrapped plugin object. - * @since 1.3RC1 + * @since 1.2.3 */ - protected XWikiPluginInterface getInternalPlugin() + protected XWikiPluginInterface getProtectedPlugin() { return plugin; } /** + * Return the inner plugin object, if the user has the required programming rights. + * + * @return The wrapped plugin object. + * @since 1.2.3 + */ + public XWikiPluginInterface getInternalPlugin() + { + if (hasProgrammingRights()) { + return plugin; + } + return null; + } + + /** * Set the inner plugin object. * * @param plugin The wrapped plugin object. _______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications