continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1238080 - in /continuum/trunk/continuum-webapp/src: main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
Date Mon, 30 Jan 2012 23:18:44 GMT
Author: ctan
Date: Mon Jan 30 23:18:44 2012
New Revision: 1238080

URL: http://svn.apache.org/viewvc?rev=1238080&view=rev
Log:
[CONTINUUM-2672] fixed checking of role for each group

Modified:
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=1238080&r1=1238079&r2=1238080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Mon Jan 30 23:18:44 2012
@@ -770,7 +770,9 @@ public class ProjectGroupAction
 
                 for ( Role role : effectiveRoles )
                 {
-                    if ( role.getName().indexOf( projectGroup.getName() ) > 0 )
+                    String projectGroupName = StringUtils.substringAfter( role.getName(),
"-" ).trim();
+
+                    if ( projectGroupName.equals( projectGroup.getName() ) )
                     {
                         pgUser.addRole( role );
                         isGroupUser = true;

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java?rev=1238080&r1=1238079&r2=1238080&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
(original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/ProjectGroupActionTest.java
Mon Jan 30 23:18:44 2012
@@ -41,11 +41,11 @@ public class ProjectGroupActionTest
         throws Exception
     {
         ProjectGroup group = new ProjectGroup();
-        group.setName( "test-group" );
+        group.setName( "Project A" );
 
         List<Role> roles = new ArrayList<Role>();
         Role role1 = new JdoRole();
-        role1.setName( "Project User - test-group" );
+        role1.setName( "Project User - Project A" );
         roles.add( role1 );
 
         Role role2 = new JdoRole();
@@ -53,11 +53,11 @@ public class ProjectGroupActionTest
         roles.add( role2 );
         
         Role role3 = new JdoRole();
-        role3.setName( "Project Developer - test-group" );
+        role3.setName( "Project Developer - Project A" );
         roles.add( role3 );
 
         Role role4 = new JdoRole();
-        role4.setName( "Project Administrator - test-group" );
+        role4.setName( "Project Administrator - Project A" );
         roles.add( role4 );
 
         List<UserAssignment> userAssignments = new ArrayList<UserAssignment>();



Mime
View raw message