geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1137129 - in /geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment: EjbDeploymentBuilder.java EjbModuleBuilder.java
Date Sat, 18 Jun 2011 05:32:20 GMT
Author: genspring
Date: Sat Jun 18 05:32:20 2011
New Revision: 1137129

URL: http://svn.apache.org/viewvc?rev=1137129&view=rev
Log:
GERONIMO-6015 JACC PolicyContextID conflicts, keep moduleId as plicyContextId for now.

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?rev=1137129&r1=1137128&r2=1137129&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
Sat Jun 18 05:32:20 2011
@@ -211,7 +211,7 @@ public class EjbDeploymentBuilder {
         }
     }
 
-    public ComponentPermissions buildComponentPermissions() throws DeploymentException {
+    public void buildComponentPermissions(ComponentPermissions componentPermissions) throws
DeploymentException {
         List<MethodPermission> methodPermissions = ejbModule.getEjbJar().getAssemblyDescriptor().getMethodPermission();
         if (earContext.getSecurityConfiguration() != null) {
             earContext.setHasSecurity(true);
@@ -219,11 +219,9 @@ public class EjbDeploymentBuilder {
         if (earContext.getSecurityConfiguration() == null && methodPermissions.size()
> 0) {
             throw new DeploymentException("Ejb app has method permissions but no security
configuration supplied in geronimo plan");
         }
-        ComponentPermissions componentPermissions = new ComponentPermissions(new Permissions(),
new Permissions(), new HashMap<String, PermissionCollection>());
         for (EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans())
{
             addSecurityData(enterpriseBean, componentPermissions);
         }
-        return componentPermissions;
     }
 
     private void addSecurityData(EnterpriseBean enterpriseBean, ComponentPermissions componentPermissions)
throws DeploymentException {

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1137129&r1=1137128&r2=1137129&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Sat Jun 18 05:32:20 2011
@@ -21,6 +21,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
+import java.security.PermissionCollection;
+import java.security.Permissions;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -1203,9 +1205,13 @@ public class EjbModuleBuilder implements
         ejbDeploymentBuilder.addEjbModuleDependency(ejbModuleGBeanData);
 
         // add the Jacc permissions to the ear
-        String policyContextID = ejbModule.getModuleURI()+"_Type_"+ejbModule.getType().getName();
-        ComponentPermissions componentPermissions = ejbDeploymentBuilder.buildComponentPermissions();
-        earContext.addSecurityContext(policyContextID, componentPermissions);
+        String policyContextId = ejbModule.getEjbInfo().getEjbJarInfo().moduleId;
+        ComponentPermissions componentPermissions = (ComponentPermissions) earContext.getContextIDToPermissionsMap().get(policyContextId);
+        if (componentPermissions == null) {
+            componentPermissions = new ComponentPermissions(new Permissions(), new Permissions(),
new HashMap<String, PermissionCollection>());
+            earContext.addSecurityContext(policyContextId, componentPermissions);
+        }
+        ejbDeploymentBuilder.buildComponentPermissions(componentPermissions);
 
         setMdbContainerIds(earContext, ejbModule, ejbModuleGBeanData);
 



Mime
View raw message