[jboss-cvs] JBossAS SVN: r104486 - branches/JBPAPP_4_2_0_GA_CP/server/src/main/org/jboss/jmx/connector/invoker.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 5 12:05:00 EDT 2010


Author: mmoyses
Date: 2010-05-05 12:04:59 -0400 (Wed, 05 May 2010)
New Revision: 104486

Modified:
   branches/JBPAPP_4_2_0_GA_CP/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java
Log:
JBPAPP-4225: fixing invocation with AuthorizationInterceptor

Modified: branches/JBPAPP_4_2_0_GA_CP/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java	2010-05-05 16:04:44 UTC (rev 104485)
+++ branches/JBPAPP_4_2_0_GA_CP/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java	2010-05-05 16:04:59 UTC (rev 104486)
@@ -29,7 +29,7 @@
 import javax.management.Attribute;
 import javax.management.ObjectName;
 import javax.security.auth.Subject;
- 
+
 import org.jboss.mx.interceptor.AbstractInterceptor;
 import org.jboss.mx.interceptor.Interceptor;
 import org.jboss.mx.server.Invocation;
@@ -118,24 +118,26 @@
                   opname = (String)ob;
                else if(ob instanceof Attribute)
                   opname = ATTRIBUTE_SET;
-               else throw new IllegalArgumentException("Opname type not recognized"); 
 
-               try
-               {
-                  checkAuthorization(caller, objname.getCanonicalName(), opname);
+               if (opname != null)
+               {  
+                  try
+                  {
+                     checkAuthorization(caller, objname.getCanonicalName(), opname);
+                  }
+                  catch(SecurityException e)
+                  {
+                     throw e;
+                  }
+                  catch(Exception e)
+                  {
+                     String msg = "Failed to authorize principal=" + caller
+                     + ",MBean=" + objname + ", Operation=" + opname;
+                     SecurityException ex = new SecurityException(msg);
+                     ex.initCause(e);
+                     throw ex;
+                  }
                }
-               catch(SecurityException e)
-               {
-                  throw e;
-               }
-               catch(Exception e)
-               {
-                  String msg = "Failed to authorize principal=" + caller
-                  + ",MBean=" + objname + ", Operation=" + opname;
-                  SecurityException ex = new SecurityException(msg);
-                  ex.initCause(e);
-                  throw ex;
-               }
             }
          }
       }




More information about the jboss-cvs-commits mailing list