continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1237542 - 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 06:06:07 GMT
Author: ctan
Date: Mon Jan 30 06:06:06 2012
New Revision: 1237542

URL: http://svn.apache.org/viewvc?rev=1237542&view=rev
Log:
[CONTINUUM-2672] fixed checking of user's roles for the 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=1237542&r1=1237541&r2=1237542&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 06:06:06 2012
@@ -770,7 +770,7 @@ public class ProjectGroupAction
 
                 for ( Role role : effectiveRoles )
                 {
-                    if ( role.getName().indexOf( projectGroup.getName() ) > -1 )
+                    if ( role.getName().indexOf( projectGroup.getName() ) > 0 )
                     {
                         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=1237542&r1=1237541&r2=1237542&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 06:06:06 2012
@@ -88,11 +88,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();
@@ -107,6 +107,10 @@ public class ProjectGroupActionTest
         role4.setName( "Project Administrator - test-group" );
         roles.add( role4 );
 
+        Role role5 = new JdoRole();
+        role5.setName( "Project Administrator - Project C" );
+        roles.add( role5 );
+
         List<UserAssignment> userAssignments = new ArrayList<UserAssignment>();
         UserAssignment ua1 = new JdoUserAssignment();
         ua1.setPrincipal( "user1" );
@@ -115,6 +119,7 @@ public class ProjectGroupActionTest
         List<Role> eRoles = new ArrayList<Role>();
         eRoles.add( role1 );
         eRoles.add( role2 );
+        eRoles.add( role5 );
 
         continuum.expects( once() ).method( "getProjectGroupWithProjects" ).will( returnValue(
group ) );
         rbac.expects( once() ).method( "getAllRoles" ).will( returnValue( roles ) );



Mime
View raw message