geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r280322 - /geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Date Mon, 12 Sep 2005 11:09:54 GMT
Author: jgenender
Date: Mon Sep 12 04:09:49 2005
New Revision: 280322

URL: http://svn.apache.org/viewcvs?rev=280322&view=rev
Log:
Fix the security portion of the deployer

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

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=280322&r1=280321&r2=280322&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
Mon Sep 12 04:09:49 2005
@@ -476,33 +476,32 @@
                 SecurityHolder securityHolder = new SecurityHolder();
                 securityHolder.setSecurityRealm(tomcatWebApp.getSecurityRealmName().trim());
 
-                if (tomcatWebApp.isSetSecurity()) {
-
-                    securityHolder.setSecurity(true);
-                    /**
-                     * TODO - go back to commented version when possible.
-                     */
-                    String policyContextID = webModuleName.getCanonicalName().replaceAll("[,
:]", "_");
-                    securityHolder.setPolicyContextID(policyContextID);
+                /**
+                 * TODO - go back to commented version when possible.
+                 */
+                String policyContextID = webModuleName.getCanonicalName().replaceAll("[,
:]", "_");
+                securityHolder.setPolicyContextID(policyContextID);
 
-                    ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp,
securityRoles, rolePermissions);
-                    securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
-                    PermissionCollection checkedPermissions = new Permissions();
-                    for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();)
{
-                        PermissionCollection permissionsForRole = (PermissionCollection)
iterator.next();
-                        for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();)
{
-                            Permission permission = (Permission) iterator2.nextElement();
-                            checkedPermissions.add(permission);
-                        }
+                ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp,
securityRoles, rolePermissions);
+                securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
+                PermissionCollection checkedPermissions = new Permissions();
+                for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();)
{
+                    PermissionCollection permissionsForRole = (PermissionCollection) iterator.next();
+                    for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();)
{
+                        Permission permission = (Permission) iterator2.nextElement();
+                        checkedPermissions.add(permission);
                     }
-                    securityHolder.setChecked(checkedPermissions);
-                    earContext.addSecurityContext(policyContextID, componentPermissions);
-//                    if (tomcatWebApp.isSetSecurity()) {
+                }
+                securityHolder.setChecked(checkedPermissions);
+                earContext.addSecurityContext(policyContextID, componentPermissions);
+                if (tomcatWebApp.isSetSecurity()) {
                     SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(tomcatWebApp.getSecurity());
                     earContext.setSecurityConfiguration(securityConfiguration);
-//                    }
-                    DefaultPrincipal defaultPrincipal = earContext.getSecurityConfiguration().getDefaultPrincipal();
-                    securityHolder.setDefaultPrincipal(defaultPrincipal);
+                }
+                DefaultPrincipal defaultPrincipal = earContext.getSecurityConfiguration().getDefaultPrincipal();
+                securityHolder.setDefaultPrincipal(defaultPrincipal);
+                if (defaultPrincipal != null){
+                    securityHolder.setSecurity(true);
                 }
 
                 webModuleData.setAttribute("securityHolder", securityHolder);



Mime
View raw message