geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1022006 - /geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java
Date Wed, 13 Oct 2010 05:59:18 GMT
Author: xuhaihong
Date: Wed Oct 13 05:59:18 2010
New Revision: 1022006

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

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java?rev=1022006&r1=1022005&r2=1022006&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java
Wed Oct 13 05:59:18 2010
@@ -113,12 +113,12 @@ public class SpecSecurityBuilder {
                 for (String urlPattern : webResourceCollection.urlPatterns) {
                     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(urlPattern, webResourceCollection.httpMethods,
webResourceCollection.omission, transport, currentPatterns);
+                            analyzeURLPattern(urlPattern, webResourceCollection.httpMethods,
webResourceCollection.omission, transport, currentRolePatterns);
                         }
                     } else {
                         analyzeURLPattern(urlPattern, webResourceCollection.httpMethods,
webResourceCollection.omission, transport, currentPatterns);
@@ -176,8 +176,9 @@ public class SpecSecurityBuilder {
             policyConfiguration.addToExcludedPolicy(new WebUserDataPermission(name, actions));
         }
         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);
                 policyConfiguration.addToRole(entry.getKey(), permission);



Mime
View raw message