[jboss-cvs] JBossAS SVN: r64749 - trunk/ejb3/src/main/org/jboss/ejb3/security.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 21 14:32:07 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-08-21 14:32:07 -0400 (Tue, 21 Aug 2007)
New Revision: 64749

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java
Log:
remove redundant method

Modified: trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java	2007-08-21 18:01:12 UTC (rev 64748)
+++ trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java	2007-08-21 18:32:07 UTC (rev 64749)
@@ -102,9 +102,7 @@
          }
          
          sc = SecurityActions.getSecurityContext();
-         
-        // SecurityContext sc = prepareSecurityContext((MethodInvocation) invocation, domain.value());
-          
+           
          //Check if there is a RunAs configured and can be trusted 
          EJBAuthenticationHelper helper = new EJBAuthenticationHelper(sc);
          boolean trustedCaller = helper.isTrusted();
@@ -151,41 +149,6 @@
       }
    } 
    
-   private SecurityContext prepareSecurityContext(MethodInvocation mi, String secDomain)
-   {
-      SecurityContext sc = null;
-      Principal p = null;
-      Object cred = null;
-      
-      InvokerLocator locator = (InvokerLocator) mi.getMetaData(InvokeRemoteInterceptor.REMOTING, 
-                  InvokeRemoteInterceptor.INVOKER_LOCATOR);
-      
-      if(locator == null)
-      {
-         //Local Call
-         SecurityContext currentSc = SecurityActions.getSecurityContext();
-         if(currentSc == null)
-            throw new IllegalStateException("Security Context null on Local call");
-         p = currentSc.getUtil().getUserPrincipal();
-         cred = currentSc.getUtil().getCredential();
-      }
-      else
-      {
-         //Remote Call
-         SecurityContext invsc = (SecurityContext) mi.getMetaData("security","context"); 
-         if(invsc == null)
-            throw new IllegalStateException("Security Context has not been set");
-         
-         p = invsc.getUtil().getUserPrincipal();
-         cred = invsc.getUtil().getCredential(); 
-      }
-      sc = SecurityActions.createSecurityContext(p, cred, null, secDomain); 
-      
-      //Set the security context
-      SecurityActions.setSecurityContext(sc);
-      return sc; 
-   }
-   
    private boolean isLocalCall(MethodInvocation mi)
    {
       InvokerLocator locator = (InvokerLocator) mi.getMetaData(InvokeRemoteInterceptor.REMOTING, 




More information about the jboss-cvs-commits mailing list