Author: dkulp Date: Fri May 4 18:00:57 2012 New Revision: 1334100 URL: http://svn.apache.org/viewvc?rev=1334100&view=rev Log: Merged revisions 1334093 via svn merge from https://svn.us.apache.org/repos/asf/cxf/branches/2.4.x-fixes
........ r1334093 | dkulp | 2012-05-04 13:54:51 -0400 (Fri, 04 May 2012) | 17 lines 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.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java?rev=1334100&r1=1334099&r2=1334100&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java (original) +++ cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java Fri May 4 18:00:57 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.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java?rev=1334100&r1=1334099&r2=1334100&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java (original) +++ cxf/branches/2.3.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java Fri May 4 18:00:57 2012 @@ -32,9 +32,27 @@ public class SimpleAuthorizingIntercepto private List<String> 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<String> getExpectedRoles(Method method) { - List<String> roles = methodRolesMap.get(method.getName()); + List<String> roles = methodRolesMap.get(createMethodSig(method)); + if (roles == null) { + roles = methodRolesMap.get(method.getName()); + } if (roles != null) { return roles; }
