geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r226718 - in /geronimo/trunk/modules: jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty/src/java/org/apache/geronimo/jetty/ tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/
Date Mon, 01 Aug 2005 02:30:47 GMT
Author: gdamour
Date: Sun Jul 31 19:30:29 2005
New Revision: 226718

URL: http://svn.apache.org/viewcvs?rev=226718&view=rev
Log:
GERONIMO-832 - Calling isUserInRole from JSP not mapped to a Servlet

Implement JACC v1_0 B.19 Calling isUserInRole from JSP not mapped to a Servlet. 

Modified:
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=226718&r1=226717&r2=226718&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Sun Jul 31 19:30:29 2005
@@ -866,9 +866,18 @@
             addServlet(webModuleName, moduleFile, previousServlet, servletType, servletMappings,
securityRoles, rolePermissions, portMap, webClassLoader, moduleJ2eeContext, earContext);
             previousServlet = servletType;
         }
-    }
 
+        // JACC v1.0 secion B.19
+        addUnmappedJSPPermissions(securityRoles, rolePermissions);
+    }
 
+    private void addUnmappedJSPPermissions(Set securityRoles, Map rolePermissions) {
+        for (Iterator iter = securityRoles.iterator(); iter.hasNext();) {
+            String roleName = (String) iter.next();
+            addPermissionToRole(roleName, new WebRoleRefPermission("", roleName), rolePermissions);
+        }
+    }
+    
     private void addServlet(ObjectName webModuleName,
                             JarFile moduleFile,
                             ServletType previousServlet,

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java?rev=226718&r1=226717&r2=226718&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java Sun
Jul 31 19:30:29 2005
@@ -135,7 +135,12 @@
         
         AccessControlContext acc = ContextManager.getCurrentContext();
         try {
-            acc.checkPermission(new WebRoleRefPermission(JettyServletHolder.getCurrentServletName(),
role));
+            // JACC v1.0 secion B.19
+            String servletName = JettyServletHolder.getCurrentServletName();
+            if (servletName.equals("jsp")) {
+                servletName = "";
+            }
+            acc.checkPermission(new WebRoleRefPermission(servletName, role));
         } catch (AccessControlException e) {
             return false;
         }

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=226718&r1=226717&r2=226718&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Sun Jul 31 19:30:29 2005
@@ -469,6 +469,10 @@
                     }
                 }
             }
+            
+            // JACC v1.0 secion B.19
+            addUnmappedJSPPermissions(securityRoles, rolePermissions);
+            
             webModuleData.setAttribute("webServices", webServices);
 
             if (tomcatWebApp.isSetSecurityRealmName()) {
@@ -539,6 +543,13 @@
 
         ClassLoader webClassLoader = new TomcatClassLoader(webClassPathURLs, baseUrl, cl,
contextPriorityClassLoader);
         return webClassLoader;
+    }
+
+    private void addUnmappedJSPPermissions(Set securityRoles, Map rolePermissions) {
+        for (Iterator iter = securityRoles.iterator(); iter.hasNext();) {
+            String roleName = (String) iter.next();
+            addPermissionToRole(roleName, new WebRoleRefPermission("", roleName), rolePermissions);
+        }
     }
 
     private void processRoleRefPermissions(ServletType servletType,



Mime
View raw message