continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r443168 - in /maven/continuum/branches/continuum-acegi: continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/initialization/ continuum-core/src/main/java/org/apache/maven/continuum...
Date Wed, 13 Sep 2006 23:44:12 GMT
Author: carlos
Date: Wed Sep 13 16:44:11 2006
New Revision: 443168

URL: http://svn.apache.org/viewvc?view=rev&rev=443168
Log:
[CONTINUUM-857] Allow several groups per user
Submitted by: Lester Ecarma

Modified:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/localization/Continuum.properties

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=443168&r1=443167&r2=443168
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Wed Sep 13 16:44:11 2006
@@ -1827,7 +1827,7 @@
 
         user.setEmail( (String) configuration.get( "user.email" ) );
 
-        user.setGroup( getUserGroup( Integer.parseInt( (String) configuration.get( "user.group"
) ) ) );
+        user.addGroup( getUserGroup( Integer.parseInt( (String) configuration.get( "user.group"
) ) ) );
 
         addUser( user );
     }
@@ -1866,7 +1866,7 @@
 
         user.setEmail( (String) configuration.get( "user.email" ) );
 
-        user.setGroup( getUserGroup( Integer.parseInt( (String) configuration.get( "user.group"
) ) ) );
+        user.addGroup( getUserGroup( Integer.parseInt( (String) configuration.get( "user.group"
) ) ) );
 
         updateUser( user );
     }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?view=diff&rev=443168&r1=443167&r2=443168
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
Wed Sep 13 16:44:11 2006
@@ -262,7 +262,7 @@
 
             guest.setFullName( "Anonymous User" );
 
-            guest.setGroup( userManager.getUserGroup( ContinuumSecurity.GUEST_GROUP_NAME
) );
+            guest.addGroup( userManager.getUserGroup( ContinuumSecurity.GUEST_GROUP_NAME
) );
 
             guest.setGuest( true );
 
@@ -294,7 +294,7 @@
 
             admin.setFullName( "Administrator" );
 
-            admin.setGroup( userManager.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME
) );
+            admin.addGroup( userManager.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME
) );
 
             admin.setPassword( "admin" );
 

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java?view=diff&rev=443168&r1=443167&r2=443168
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java
Wed Sep 13 16:44:11 2006
@@ -21,6 +21,7 @@
 import org.apache.maven.continuum.model.system.UserGroup;
 import org.apache.maven.user.model.UserManager;
 
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
@@ -45,8 +46,16 @@
         {
             u = getGuestUser();
         }
+        
+        List groups = u.getGroups();
+        Iterator it = groups.iterator();
+        List permissions = new ArrayList();
+        while( it.hasNext() )
+        {
+            permissions.addAll( getPermissions( (UserGroup) it.next() ) );
+        }
 
-        return getPermissions( ( UserGroup ) u.getGroup() );
+        return permissions;
     }
 
     public List getPermissions( UserGroup group )

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/localization/Continuum.properties?view=diff&rev=443168&r1=443167&r2=443168
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Sep 13 16:44:11 2006
@@ -412,6 +412,7 @@
 role.page.title = Continuum - Roles List
 role.section.title = Roles List
 role.rolename = Roles
+user.group.header = Groups
 
 # ----------------------------------------------------------------------
 # Page: Add/Edit/DeleteUsergroups



Mime
View raw message