continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r484878 - in /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action: AddMavenProjectAction.java AddMavenTwoProjectAction.java AddProjectAction.java AddProjectGroupAction.java ScheduleAction.java
Date Sat, 09 Dec 2006 01:18:27 GMT
Author: jmcconnell
Date: Fri Dec  8 17:18:26 2006
New Revision: 484878

URL: http://svn.apache.org/viewvc?view=rev&rev=484878
Log:
secure a few actions to reprevent authorized usage

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java?view=diff&rev=484878&r1=484877&r2=484878
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenProjectAction.java
Fri Dec  8 17:18:26 2006
@@ -16,6 +16,15 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.util.StringUtils;
+
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -23,11 +32,6 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.model.project.ProjectGroup;
-import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
-import org.codehaus.plexus.util.StringUtils;
-
 /**
  * Action to add a Maven project to Continuum, either Maven 1 or Maven 2.
  * 
@@ -36,6 +40,7 @@
  */
 public abstract class AddMavenProjectAction
     extends ContinuumActionSupport
+    implements SecureAction
 {
 
     private static final long serialVersionUID = -3965565189557706469L;
@@ -261,4 +266,16 @@
     {
         this.disableGroupSelection = disableGroupSelection;
     }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+        {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_ADD_GROUP_OPERATION
);
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_ADD_PROJECT_TO_GROUP_OPERATION,
projectGroupName );
+
+        return bundle;
+    }
+
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java?view=diff&rev=484878&r1=484877&r2=484878
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.java
Fri Dec  8 17:18:26 2006
@@ -16,10 +16,13 @@
  * limitations under the License.
  */
 
-import java.io.File;
-
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+
+import java.io.File;
 
 /**
  * Add a Maven 2 project to Continuum.
@@ -78,4 +81,15 @@
     {
         setPomUrl( pomUrl );
     }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_ADD_GROUP_OPERATION
);
+
+        return bundle;
+    }
+
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?view=diff&rev=484878&r1=484877&r2=484878
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
Fri Dec  8 17:18:26 2006
@@ -16,12 +16,15 @@
  * limitations under the License.
  */
 
-import java.util.Iterator;
-
+import com.opensymphony.xwork.Validateable;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
 
-import com.opensymphony.xwork.Validateable;
+import java.util.Iterator;
 
 /**
  * @author Nick Gonzalez
@@ -33,7 +36,7 @@
  */
 public class AddProjectAction
     extends ContinuumActionSupport
-    implements Validateable
+    implements Validateable, SecureAction
 {
 
     private String projectName;
@@ -176,5 +179,16 @@
     public void setProjectVersion( String projectVersion )
     {
         this.projectVersion = projectVersion;
+    }
+
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_ADD_GROUP_OPERATION
);
+
+        return bundle;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java?view=diff&rev=484878&r1=484877&r2=484878
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectGroupAction.java
Fri Dec  8 17:18:26 2006
@@ -16,12 +16,15 @@
  * limitations under the License.
  */
 
-import java.util.Iterator;
-
-import org.apache.maven.continuum.model.project.ProjectGroup;
+import com.opensymphony.xwork.Validateable;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
 
-import com.opensymphony.xwork.Validateable;
+import java.util.Iterator;
 
 /**
  * @author Henry Isidro <hisidro@exist.com>
@@ -32,7 +35,7 @@
  */
 public class AddProjectGroupAction
     extends ContinuumActionSupport
-    implements Validateable
+    implements Validateable, SecureAction
 {
     private String name;
 
@@ -119,4 +122,15 @@
     {
         this.name = name;
     }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_ADD_GROUP_OPERATION
);
+
+        return bundle;
+    }
+
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java?view=diff&rev=484878&r1=484877&r2=484878
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ScheduleAction.java
Fri Dec  8 17:18:26 2006
@@ -17,7 +17,11 @@
  */
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.model.project.Schedule;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureAction;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionBundle;
+import org.codehaus.plexus.security.ui.web.interceptor.SecureActionException;
 
 import java.util.Collection;
 
@@ -27,6 +31,7 @@
  */
 public class ScheduleAction
     extends ContinuumConfirmAction
+    implements SecureAction
 {
     private int id;
 
@@ -322,5 +327,15 @@
     {
         return ( second + " " + minute + " " + hour + " " + dayOfMonth + " " +
                     month + " " + dayOfWeek + " " + year ).trim();
+    }
+
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_SCHEDULES
);
+
+        return bundle;
     }
 }



Mime
View raw message