continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r563651 - in /maven/continuum/trunk: continuum-security/src/main/java/org/apache/maven/continuum/security/ continuum-security/src/main/resources/META-INF/redback/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ c...
Date Tue, 07 Aug 2007 20:45:35 GMT
Author: evenisse
Date: Tue Aug  7 13:45:34 2007
New Revision: 563651

URL: http://svn.apache.org/viewvc?view=rev&rev=563651
Log:
[CONTINUUM-1373] Add security on profiles/Installations pages
Submitted by: Olivier Lamy

Modified:
    maven/continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
    maven/continuum/trunk/continuum-security/src/main/resources/META-INF/redback/redback.xml
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp

Modified: maven/continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java?view=diff&rev=563651&r1=563650&r2=563651
==============================================================================
--- maven/continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
(original)
+++ maven/continuum/trunk/continuum-security/src/main/java/org/apache/maven/continuum/security/ContinuumRoleConstants.java
Tue Aug  7 13:45:34 2007
@@ -108,4 +108,7 @@
 
     public static final String USER_MANAGEMENT_USER_ROLE_OPERATION = "user-management-user-role";
 
+    public static final String CONTINUUM_MANAGE_INSTALLATIONS = "continuum-manage-installations";
+    
+    public static final String CONTINUUM_MANAGE_PROFILES = "continuum-manage-profiles";
 }

Modified: maven/continuum/trunk/continuum-security/src/main/resources/META-INF/redback/redback.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-security/src/main/resources/META-INF/redback/redback.xml?view=diff&rev=563651&r1=563650&r2=563651
==============================================================================
--- maven/continuum/trunk/continuum-security/src/main/resources/META-INF/redback/redback.xml
(original)
+++ maven/continuum/trunk/continuum-security/src/main/resources/META-INF/redback/redback.xml
Tue Aug  7 13:45:34 2007
@@ -127,6 +127,16 @@
       <name>continuum-modify-project-notifier</name>
       <description>Continuum Modify Project Notifier</description>
     </operation>
+    <operation>
+      <id>continuum-manage-installations</id>
+      <name>continuum-manage-installations</name>
+      <description>Continuum Manage Installations</description>
+    </operation>
+    <operation>
+      <id>continuum-manage-profiles</id>
+      <name>continuum-manage-profiles</name>
+      <description>Continuum Manage Installations</description>
+    </operation>        
   </operations>
   <roles>
     <role>
@@ -148,7 +158,21 @@
           <permanent>true</permanent>
           <operation>continuum-manage-schedules</operation>
           <resource>global</resource>
-        </permission>        
+        </permission>
+        <permission>
+          <id>continuum-manage-profiles</id>
+          <name>Manage Continuum Profiles</name>
+          <permanent>true</permanent>          
+          <operation>continuum-manage-profiles</operation>
+          <resource>global</resource>
+        </permission> 
+        <permission>
+          <id>continuum-manage-installations</id>
+          <name>Manage Continuum Installations</name>
+          <permanent>true</permanent>          
+          <operation>continuum-manage-installations</operation>
+          <resource>global</resource>
+        </permission>               
       </permissions>
       <parentRoles>
         <parentRole>system-administrator</parentRole>
@@ -227,6 +251,36 @@
         <parentRole>guest</parentRole>
       </parentRoles>
     </role>
+    <role>
+      <id>continuum-manage-installations</id>
+      <name>Continuum Manage Installations</name>
+      <assignable>true</assignable>
+      <permanent>true</permanent>
+      <permissions>
+        <permission>
+          <id>continuum-manage-installations</id>
+          <name>Manage Continuum Installations</name>
+          <permanent>true</permanent>
+          <operation>continuum-manage-installations</operation>
+          <resource>global</resource>
+        </permission>        
+      </permissions>
+    </role>
+    <role>
+      <id>continuum-manage-profiles</id>
+      <name>Continuum Manage Profiles</name>
+      <assignable>true</assignable>
+      <permanent>true</permanent>
+      <permissions>
+        <permission>
+          <id>continuum-manage-profiles</id>
+          <name>Manage Continuum Profiles</name>
+          <permanent>true</permanent>
+          <operation>continuum-manage-profiles</operation>
+          <resource>global</resource>
+        </permission>        
+      </permissions>
+    </role>        
   </roles>
   <templates>
   	<template>
@@ -404,4 +458,4 @@
   	  </parentRoles>
   	</template>
   </templates>
-</redback-role-model>
\ No newline at end of file
+</redback-role-model>

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java?view=diff&rev=563651&r1=563650&r2=563651
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java
Tue Aug  7 13:45:34 2007
@@ -3,7 +3,12 @@
 import com.opensymphony.xwork.Preparable;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
@@ -37,7 +42,7 @@
  */
 public class InstallationAction
     extends ContinuumActionSupport
-    implements Preparable
+    implements Preparable, SecureAction
 {
 
     /**
@@ -125,6 +130,20 @@
         installationService.delete( installationToDelete );
         this.installations = installationService.getAllInstallations();
         return SUCCESS;
+    }
+
+    // -----------------------------------------------------
+    // security
+    // -----------------------------------------------------    
+    
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_INSTALLATIONS,
Resource.GLOBAL );
+
+        return bundle;
     }
 
     // -----------------------------------------------------

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java?view=diff&rev=563651&r1=563650&r2=563651
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
Tue Aug  7 13:45:34 2007
@@ -19,17 +19,24 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.profile.ProfileService;
+import org.apache.maven.continuum.security.ContinuumRoleConstants;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
+import org.codehaus.plexus.redback.rbac.Resource;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureAction;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
+import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
+import com.opensymphony.xwork.Preparable;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -57,6 +64,7 @@
  */
 public class ProfileAction
     extends ContinuumActionSupport
+    implements Preparable, SecureAction
 
 {
     /**
@@ -199,6 +207,20 @@
         return SUCCESS;
     }
 
+    // -----------------------------------------------------
+    // security
+    // -----------------------------------------------------    
+    
+    public SecureActionBundle getSecureActionBundle()
+        throws SecureActionException
+    {
+        SecureActionBundle bundle = new SecureActionBundle();
+        bundle.setRequiresAuthentication( true );
+        bundle.addRequiredAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_PROFILES,
Resource.GLOBAL );
+
+        return bundle;
+    }    
+    
     // -------------------------------------------------------
     // Webwork setter/getter
     // -------------------------------------------------------

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp?view=diff&rev=563651&r1=563650&r2=563651
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
Tue Aug  7 13:45:34 2007
@@ -82,7 +82,7 @@
   </redback:ifAuthorized>
 
 
-  <redback:ifAnyAuthorized permissions="continuum-manage-schedules,continuum-manage-configuration,continuum-manage-users">
+  <redback:ifAnyAuthorized permissions="continuum-manage-schedules,continuum-manage-configuration,continuum-manage-users,continuum-manage-installations,continuum-manage-profiles">
     <div id="projectmenu" class="toolgroup">
       <div class="label">
         <ww:text name="menu.administration"/>
@@ -96,19 +96,23 @@
             </ww:a>
           </div>
         </redback:ifAuthorized>
-        <redback:ifAuthorized permission="continuum-manage-configuration">
+        <redback:ifAuthorized permission="continuum-manage-profiles">
           <ww:url id="configurationUrl" action="profilesList" namespace="/admin" method="list"
includeParams="none"/>
           <div class="body">
             <ww:a href="%{configurationUrl}">
               <ww:text name="menu.administration.profile"/>
             </ww:a>
-          </div>     
+          </div> 
+        </redback:ifAuthorized> 
+        <redback:ifAuthorized permission="continuum-manage-installations">   
           <ww:url id="configurationUrl" action="installationsList" namespace="/admin"
method="list" includeParams="none"/>
           <div class="body">
             <ww:a href="%{configurationUrl}">
               <ww:text name="menu.administration.installations"/>
             </ww:a>
-          </div>               
+          </div>
+        </redback:ifAuthorized>
+        <redback:ifAuthorized permission="continuum-manage-configuration">        
      
           <ww:url id="configurationUrl" action="configuration" namespace="/admin" method="input"
includeParams="none"/>
           <div class="body">
             <ww:a href="%{configurationUrl}">



Mime
View raw message