[jboss-cvs] JBossAS SVN: r57480 - 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 16:44:03 EDT 2006


Author: anil.saldhana at jboss.com
Date: 2006-10-06 16:44:02 -0400 (Fri, 06 Oct 2006)
New Revision: 57480

Modified:
   branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java
Log:
Ensure security domain value is of proper format

Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java	2006-10-06 20:12:44 UTC (rev 57479)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java	2006-10-06 20:44:02 UTC (rev 57480)
@@ -46,7 +46,7 @@
       {
          InitialContext ctx = container.getInitialContext();
          org.jboss.annotation.security.SecurityDomain securityAnnotation = (org.jboss.annotation.security.SecurityDomain) advisor.resolveAnnotation(org.jboss.annotation.security.SecurityDomain.class);
-         domain = ctx.lookup("java:/jaas/" + securityAnnotation.value());
+         domain = ctx.lookup(preProcessSecurityDomain(securityAnnotation.value()));
       }
       catch (NamingException e)
       {
@@ -77,5 +77,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