[jboss-cvs] JBossAS SVN: r57485 - branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 6 18:21:39 EDT 2006


Author: anil.saldhana at jboss.com
Date: 2006-10-06 18:21:38 -0400 (Fri, 06 Oct 2006)
New Revision: 57485

Modified:
   branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java
Log:
EJBTHREE-730:correct the security domain value used in obtaining the security mgr

Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java	2006-10-06 21:29:19 UTC (rev 57484)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java	2006-10-06 22:21:38 UTC (rev 57485)
@@ -48,7 +48,7 @@
          SecurityDomain securityAnnotation = (SecurityDomain) advisor.resolveAnnotation(SecurityDomain.class);
          if (securityAnnotation != null)
          {
-            domain = ctx.lookup("java:/jaas/" + securityAnnotation.value());
+            domain = ctx.lookup(preProcessSecurityDomain(securityAnnotation.value()));
          }
       }
       catch (NamingException e)
@@ -78,5 +78,18 @@
    {
       return getClass().getName();
    }
+   
+   /**
+    * Ensure that the security domain is of the proper format
+    * @param domainValue
+    * @return
+    */
+   private String preProcessSecurityDomain(String domainValue)
+   { 
+      if(domainValue.startsWith("java:/jaas"))
+         return domainValue;
+      else
+         return "java:/jaas/" + domainValue;
+   }
 }
 




More information about the jboss-cvs-commits mailing list