continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r447215 - in /maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src: main/java/org/apache/maven/continuum/security/acegi/aspectj/ test/java/org/apache/maven/continuum/security/acegi/aspectj/ test/resources...
Date Mon, 18 Sep 2006 03:34:19 GMT
Author: carlos
Date: Sun Sep 17 20:34:18 2006
New Revision: 447215

URL: http://svn.apache.org/viewvc?view=rev&rev=447215
Log:
Add test for project removal

Modified:
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/aspectj/ContinuumSecurityAspect.aj
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.java
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/resources/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.xml

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/aspectj/ContinuumSecurityAspect.aj
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/aspectj/ContinuumSecurityAspect.aj?view=diff&rev=447215&r1=447214&r2=447215
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/aspectj/ContinuumSecurityAspect.aj
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/aspectj/ContinuumSecurityAspect.aj
Sun Sep 17 20:34:18 2006
@@ -31,6 +31,7 @@
     protected pointcut securedExecution():
         target(Continuum) &&
         execution(public * *(..)) &&
+        !execution(public * remove*(int)) &&
         !within(ContinuumSecurityAspect);
 
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.java?view=diff&rev=447215&r1=447214&r2=447215
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.java
Sun Sep 17 20:34:18 2006
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 
+import org.acegisecurity.context.SecurityContextHolder;
 import org.apache.maven.continuum.Continuum;
 
 public class ProjectSecurityPlexusTest
@@ -29,4 +30,10 @@
         setContinuum( (ContinuumStub) lookup( Continuum.ROLE, "stub" ) );
     }
 
+    public void testRemoveProject()
+        throws Exception
+    {
+        SecurityContextHolder.getContext().setAuthentication( getAuthentication( "USER" )
);
+        getContinuum().removeProject( 1 );
+    }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/resources/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/resources/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.xml?view=diff&rev=447215&r1=447214&r2=447215
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/resources/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.xml
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/resources/org/apache/maven/continuum/security/acegi/aspectj/ProjectSecurityPlexusTest.xml
Sun Sep 17 20:34:18 2006
@@ -116,6 +116,13 @@
                 <configAttribute>AFTER_ACL_COLLECTION_READ</configAttribute>
               </configAttributes>
             </methodDefinitionSourceMapping>
+            <methodDefinitionSourceMapping>
+              <methodName>org.apache.maven.continuum.Continuum.removeProject</methodName>
+              <configAttributes>
+                <configAttribute>ROLE_ADMIN</configAttribute>
+                <configAttribute>ACL_PROJECT_DELETE</configAttribute>
+              </configAttributes>
+            </methodDefinitionSourceMapping>
           </mappings>
         </objectDefinitionSource>
       </configuration>
@@ -178,6 +185,26 @@
         <requirePermissionFromString>
           <permission>ADMINISTRATION</permission>
           <permission>READ</permission>
+        </requirePermissionFromString>
+      </configuration>
+    </component>
+
+    <component>
+      <role>org.acegisecurity.vote.AccessDecisionVoter</role>
+      <role-hint>aclProjectDelete</role-hint>
+      <implementation>org.acegisecurity.vote.BasicAclEntryVoter</implementation>
+      <requirements>
+        <requirement>
+          <role>org.acegisecurity.acl.AclManager</role>
+          <field-name>aclManager</field-name>
+        </requirement>
+      </requirements>
+      <configuration>
+        <processConfigAttribute>ACL_PROJECT_DELETE</processConfigAttribute>
+        <processDomainObjectClass>org.apache.maven.continuum.model.project.Project</processDomainObjectClass>
+        <requirePermissionFromString>
+          <permission>ADMINISTRATION</permission>
+          <permission>DELETE</permission>
         </requirePermissionFromString>
       </configuration>
     </component>



Mime
View raw message