karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject git commit: [KARAF-3001]RBAC - MBean Server RBAC guard should support wildcard role (cherry picked from commit cc031a963d9f642cae789ad4efc4c5a86b819b4e)
Date Mon, 26 May 2014 05:59:51 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-3.0.x 3235413db -> 3cb7336f9


[KARAF-3001]RBAC - MBean Server RBAC guard should support wildcard role
(cherry picked from commit cc031a963d9f642cae789ad4efc4c5a86b819b4e)


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/3cb7336f
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/3cb7336f
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/3cb7336f

Branch: refs/heads/karaf-3.0.x
Commit: 3cb7336f9b71118a13defcceedac205bcb52b2a0
Parents: 3235413
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Mon May 26 13:50:45 2014 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Mon May 26 13:53:09 2014 +0800

----------------------------------------------------------------------
 .../org/apache/karaf/management/KarafMBeanServerGuard.java     | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/3cb7336f/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
----------------------------------------------------------------------
diff --git a/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
b/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
index c241ac2..55bbe69 100644
--- a/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
+++ b/management/server/src/main/java/org/apache/karaf/management/KarafMBeanServerGuard.java
@@ -36,6 +36,8 @@ import java.util.*;
 public class KarafMBeanServerGuard implements InvocationHandler {
 
     private static final String JMX_ACL_PID_PREFIX = "jmx.acl";
+    
+    private static final String ROLE_WILDCARD = "*";
 
     private ConfigurationAdmin configAdmin;
 
@@ -302,6 +304,10 @@ public class KarafMBeanServerGuard implements InvocationHandler {
     }
 
     static boolean currentUserHasRole(String requestedRole) {
+        if (ROLE_WILDCARD.equals(requestedRole)) {
+            return true;
+        }
+        
         String clazz;
         String role;
         int index = requestedRole.indexOf(':');


Mime
View raw message