From commits-return-6482-apmail-continuum-commits-archive=continuum.apache.org@continuum.apache.org Mon Jan 30 23:19:06 2012 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 C1B7C9D64 for ; Mon, 30 Jan 2012 23:19:06 +0000 (UTC) Received: (qmail 53655 invoked by uid 500); 30 Jan 2012 23:19:06 -0000 Delivered-To: apmail-continuum-commits-archive@continuum.apache.org Received: (qmail 53597 invoked by uid 500); 30 Jan 2012 23:19:05 -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 53590 invoked by uid 99); 30 Jan 2012 23:19:05 -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 23:19:05 +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 23:19:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7FD1623888E4 for ; Mon, 30 Jan 2012 23:18:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@continuum.apache.org From: ctan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120130231844.7FD1623888E4@eris.apache.org> 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 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(); @@ -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 userAssignments = new ArrayList();