Commits

Oswaldo Hernandez committed 4a60954

ROTP-597 ROTP-612 CONFDEV-7166 CONFDEV-11662: Only display the uwc importer admin page in Confluence behind the firewall.

Comments (0)

Files changed (2)

src/main/java/com/atlassian/confluence/plugins/uwc/uwcimporter/UWCImporterAction.java

 package com.atlassian.confluence.plugins.uwc.uwcimporter;
 
+import com.atlassian.confluence.core.ConfluenceActionSupport;
+import com.atlassian.confluence.setup.settings.ConfluenceFlavour;
+import com.atlassian.confluence.util.GeneralUtil;
+import com.atlassian.confluence.util.i18n.I18NBean;
+import org.apache.log4j.Logger;
+
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.log4j.Logger;
-
-import com.atlassian.confluence.core.ConfluenceActionSupport;
-import com.atlassian.confluence.util.GeneralUtil;
-import com.atlassian.confluence.util.i18n.I18NBean;
-
 /**
  * Action used by UWC Importer webitem.
  */
 public class UWCImporterAction extends ConfluenceActionSupport {
 
 	Logger log = Logger.getLogger(this.getClass());
-	public boolean isPermitted() {
-		/* XXX overridden instead of implementing deprecated Administrative.
-		 * Described here: http://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/core/Administrative.html
-		 */
-		return true;  
+
+    public boolean isPermitted() {
+		return ConfluenceFlavour.selected().equals(ConfluenceFlavour.VANILLA);
 	}
-	
+
 	public String execute() {
 		//go straight to velocity template
 		return SUCCESS; 

src/main/resources/atlassian-plugin.xml

 		<icon height="16" width="16">
         	<link>/images/icons/logo_add_16.gif</link>
     	</icon>
-	</web-item>
+        <condition class="com.atlassian.confluence.plugin.descriptor.web.conditions.ConfluenceFlavourCondition">
+            <param name="flavour">VANILLA</param>
+        </condition>
+    </web-item>
 
 	<xwork name="UWC Importer Actions" 
 		   key="uwc-importer-actions">