continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r442736 - /maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/acl/AclEventHandler.java
Date Tue, 12 Sep 2006 22:18:53 GMT
Author: carlos
Date: Tue Sep 12 15:18:51 2006
New Revision: 442736

URL: http://svn.apache.org/viewvc?view=rev&rev=442736
Log:
Refactor to expose afterAddProject

Modified:
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/acl/AclEventHandler.java

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/acl/AclEventHandler.java
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/acl/AclEventHandler.java?view=diff&rev=442736&r1=442735&r2=442736
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/acl/AclEventHandler.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/acl/AclEventHandler.java
Tue Sep 12 15:18:51 2006
@@ -57,7 +57,7 @@
                     + projectGroups );
             }
             ProjectGroup projectGroup = (ProjectGroup) projectGroups.iterator().next();
-            createNewProjectsACLs( result.getProjects(), projectGroup );
+            createNewProjectsACLs( result.getProjects(), projectGroup.getId() );
         }
     }
 
@@ -72,6 +72,21 @@
     }
 
     /**
+     * Set {@link ProjectGroup} permissions in all objects
+     * 
+     * @param projectGroups
+     */
+    public void afterReturningProjectGroup( Collection projectGroups )
+    {
+        Iterator it = projectGroups.iterator();
+        while ( it.hasNext() )
+        {
+            ProjectGroup projectGroup = (ProjectGroup) it.next();
+            //            projectGroup.s
+        }
+    }
+
+    /**
      * Call this method when new {@link ProjectGroup}s are created.
      * 
      * @param projectGroups
@@ -112,30 +127,30 @@
      * 
      * @param projects
      */
-    protected void createNewProjectsACLs( Collection projects, ProjectGroup projectGroup
)
+    protected void createNewProjectsACLs( Collection projects, int projectGroupId )
     {
         Iterator it = projects.iterator();
         while ( it.hasNext() )
         {
             Project project = (Project) it.next();
-            createNewProjectACL( project, projectGroup );
+            afterAddProject( project, projectGroupId );
         }
     }
 
     /**
-     * Project has same permissions as its project group.
+     * Create ACL for new {@link Project}, it has same permissions as its project group.
      * 
      * @param project
-     * @param projectGroup group the projects belong to
+     * @param projectGroupId group the projects belong to
      */
-    protected void createNewProjectACL( Project project, ProjectGroup projectGroup )
+    public void afterAddProject( Project project, int projectGroupId )
     {
         InstancePermissions permission = new InstancePermissions();
         permission.setUser( null );
         permission.setInstanceClass( Project.class );
         permission.setId( new Integer( project.getId() ) );
         permission.setParentClass( ProjectGroup.class );
-        permission.setParentId( new Integer( projectGroup.getId() ) );
+        permission.setParentId( new Integer( projectGroupId ) );
 
         setUsersInstancePermission( permission );
     }



Mime
View raw message