geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1022004 - /geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Date Wed, 13 Oct 2010 05:56:33 GMT
Author: xuhaihong
Date: Wed Oct 13 05:56:33 2010
New Revision: 1022004

URL: http://svn.apache.org/viewvc?rev=1022004&view=rev
Log:
GERONIMO-5640 Qualified web resource permission for each role should be calculated based its
own url set

Modified:
    geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=1022004&r1=1022003&r2=1022004&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/branches/2.1/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Wed Oct 13 05:56:33 2010
@@ -509,17 +509,16 @@ public abstract class AbstractWebModuleB
             }
 
             for (WebResourceCollectionType webResourceCollectionType : securityConstraintType.getWebResourceCollectionArray())
{
-                UrlPatternType[] urlPatternTypeArray = webResourceCollectionType.getUrlPatternArray();
-                for (UrlPatternType urlPatternType : urlPatternTypeArray) {
+                for (UrlPatternType urlPatternType : webResourceCollectionType.getUrlPatternArray())
{
                     String url = urlPatternType.getStringValue().trim();
-                    if(currentPatterns == null) {
+                    if (currentPatterns == null) {
                         for (String roleName : roleNames) {
-                            currentPatterns = rolesPatterns.get(roleName);
-                            if (currentPatterns == null) {
-                                currentPatterns = new HashMap<String, URLPattern>();
-                                rolesPatterns.put(roleName, currentPatterns);
+                            Map<String, URLPattern> currentRolePatterns = rolesPatterns.get(roleName);
+                            if (currentRolePatterns == null) {
+                                currentRolePatterns = new HashMap<String, URLPattern>();
+                                rolesPatterns.put(roleName, currentRolePatterns);
                             }
-                            analyzeURLPattern(url, webResourceCollectionType.getHttpMethodArray(),
transport, currentPatterns);
+                            analyzeURLPattern(url, webResourceCollectionType.getHttpMethodArray(),
transport, currentRolePatterns);
                         }
                     } else {
                         analyzeURLPattern(url, webResourceCollectionType.getHttpMethodArray(),
transport, currentPatterns);
@@ -547,8 +546,9 @@ public abstract class AbstractWebModuleB
         }
 
         for (Map.Entry<String, Map<String, URLPattern>> entry : rolesPatterns.entrySet())
{
+            Set<URLPattern> currentRolePatterns = new HashSet<URLPattern>(entry.getValue().values());
             for (URLPattern pattern : entry.getValue().values()) {
-                String name = pattern.getQualifiedPattern(allSet);
+                String name = pattern.getQualifiedPattern(currentRolePatterns);
                 String actions = pattern.getMethods();
                 WebResourcePermission permission = new WebResourcePermission(name, actions);
                 addPermissionToRole(entry.getKey(), permission, rolePermissions);



Mime
View raw message