Return-Path: X-Original-To: apmail-continuum-commits-archive@www.apache.org Delivered-To: apmail-continuum-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88EB198CF for ; Mon, 30 Jan 2012 06:06:47 +0000 (UTC) Received: (qmail 20597 invoked by uid 500); 30 Jan 2012 06:06:46 -0000 Delivered-To: apmail-continuum-commits-archive@continuum.apache.org Received: (qmail 20534 invoked by uid 500); 30 Jan 2012 06:06:34 -0000 Mailing-List: contact commits-help@continuum.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@continuum.apache.org Delivered-To: mailing list commits@continuum.apache.org Received: (qmail 20512 invoked by uid 99); 30 Jan 2012 06:06:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2012 06:06:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2012 06:06:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3CCBC238890B for ; Mon, 30 Jan 2012 06:06:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@continuum.apache.org From: ctan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120130060607.3CCBC238890B@eris.apache.org> 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 roles = new ArrayList(); 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 userAssignments = new ArrayList(); UserAssignment ua1 = new JdoUserAssignment(); ua1.setPrincipal( "user1" ); @@ -115,6 +119,7 @@ public class ProjectGroupActionTest List eRoles = new ArrayList(); 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 ) );