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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 9 15:53:25 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-10-09 15:53:25 -0400 (Tue, 09 Oct 2007)
New Revision: 65987

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java
Log:
use the ejbauthentication helper

Modified: trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java	2007-10-09 19:51:19 UTC (rev 65986)
+++ trunk/ejb3/src/main/org/jboss/ejb3/security/Ejb3AuthenticationInterceptorv2.java	2007-10-09 19:53:25 UTC (rev 65987)
@@ -115,9 +115,6 @@
                sc = SecurityActions.createSecurityContext(p, 
                      cred, null, unprefixed); 
                
-               //TODO: Need to get the SecurityManagement instance
-               sc.setSecurityManagement(new JNDIBasedSecurityManagement());
-               
                //Set the security context
                SecurityActions.setSecurityContext(sc);
                sc.getUtil().setSecurityIdentity(invSC.getUtil().getSecurityIdentity());
@@ -125,14 +122,14 @@
          }
          
          sc = SecurityActions.getSecurityContext();
+         //TODO: Need to get the SecurityManagement instance
+         sc.setSecurityManagement(new JNDIBasedSecurityManagement());
            
          //Check if there is a RunAs configured and can be trusted 
          EJBAuthenticationHelper helper = new EJBAuthenticationHelper(sc);
          boolean trustedCaller = helper.isTrusted();
          if(!trustedCaller)
          {
-            if(helper.isTrustDenied())
-               throw new EJBAccessException("Untrusted Caller");
             Subject subject = new Subject();
             /**
              * Special Case: Invocation has no principal set, 
@@ -149,7 +146,7 @@
             else
             { 
                //Authenticate the caller now
-               if(!helper.isValid(subject))
+               if(!helper.isValid(subject, method.getName()))
                   throw new EJBAccessException("Invalid User"); 
             }
             helper.pushSubjectContext(subject);




More information about the jboss-cvs-commits mailing list