Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-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 E331FC8FC for ; Fri, 4 May 2012 17:55:13 +0000 (UTC) Received: (qmail 82217 invoked by uid 500); 4 May 2012 17:55:13 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 82169 invoked by uid 500); 4 May 2012 17:55:13 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 82162 invoked by uid 99); 4 May 2012 17:55:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2012 17:55:13 +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; Fri, 04 May 2012 17:55:12 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3A47623888CD; Fri, 4 May 2012 17:54:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1334093 - in /cxf/branches/2.4.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java Date: Fri, 04 May 2012 17:54:52 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120504175452.3A47623888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri May 4 17:54:51 2012 New Revision: 1334093 URL: http://svn.apache.org/viewvc?rev=1334093&view=rev Log: Merged revisions 1334087 via svn merge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ........ r1334087 | dkulp | 2012-05-04 13:48:39 -0400 (Fri, 04 May 2012) | 9 lines Merged revisions 1334084 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1334084 | dkulp | 2012-05-04 13:46:29 -0400 (Fri, 04 May 2012) | 2 lines [CXF-4288] Consider the full signature when mapping methods to roles ........ ........ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java?rev=1334093&r1=1334092&r2=1334093&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java (original) +++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java Fri May 4 17:54:51 2012 @@ -85,6 +85,7 @@ public class SecureAnnotationsIntercepto String theRoles = methodRolesAllowed != null ? methodRolesAllowed : classRolesAllowed; if (theRoles != null) { rolesMap.put(m.getName(), theRoles); + rolesMap.put(createMethodSig(m), theRoles); } } if (!rolesMap.isEmpty()) { Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java?rev=1334093&r1=1334092&r2=1334093&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java (original) +++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java Fri May 4 17:54:51 2012 @@ -32,9 +32,27 @@ public class SimpleAuthorizingIntercepto private List globalRoles = Collections.emptyList(); + protected String createMethodSig(Method method) { + StringBuilder b = new StringBuilder(method.getReturnType().getName()); + b.append(' ').append(method.getName()).append('('); + boolean first = true; + for (Class cls : method.getParameterTypes()) { + if (!first) { + b.append(", "); + first = false; + } + b.append(cls.getName()); + } + b.append(')'); + return b.toString(); + } + @Override protected List getExpectedRoles(Method method) { - List roles = methodRolesMap.get(method.getName()); + List roles = methodRolesMap.get(createMethodSig(method)); + if (roles == null) { + roles = methodRolesMap.get(method.getName()); + } if (roles != null) { return roles; }