karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [50/50] [abbrv] karaf git commit: [KARAF-4636]karaf.secured.command.compulsory.roles does not work
Date Mon, 22 Aug 2016 09:30:48 GMT
[KARAF-4636]karaf.secured.command.compulsory.roles does not work

(cherry picked from commit b90072722b45985e73a89ee85adce9c3a3011e95)


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

Branch: refs/heads/master
Commit: 2f05d66499aa60e7f60762accdd51f00006d204f
Parents: dbb58a5
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Thu Aug 18 10:53:41 2016 +0800
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Mon Aug 22 11:29:22 2016 +0200

----------------------------------------------------------------------
 .../service/guard/tools/ACLConfigurationParser.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/2f05d664/service/guard/src/main/java/org/apache/karaf/service/guard/tools/ACLConfigurationParser.java
----------------------------------------------------------------------
diff --git a/service/guard/src/main/java/org/apache/karaf/service/guard/tools/ACLConfigurationParser.java
b/service/guard/src/main/java/org/apache/karaf/service/guard/tools/ACLConfigurationParser.java
index d47ada2..a5812b9 100644
--- a/service/guard/src/main/java/org/apache/karaf/service/guard/tools/ACLConfigurationParser.java
+++ b/service/guard/src/main/java/org/apache/karaf/service/guard/tools/ACLConfigurationParser.java
@@ -18,6 +18,8 @@ package org.apache.karaf.service.guard.tools;
 
 import java.util.*;
 
+import org.apache.karaf.service.guard.impl.GuardProxyCatalog;
+
 public class ACLConfigurationParser {
 
     // note that the order of the enums is important. Needs to be from most specific to least
specific.
@@ -29,6 +31,12 @@ public class ACLConfigurationParser {
         NO_MATCH
     };
 
+    static String compulsoryRoles;
+    
+    static {
+        compulsoryRoles = System.getProperty(GuardProxyCatalog.KARAF_SECURED_COMMAND_COMPULSORY_ROLES_PROPERTY);
+    }
+    
     /**
      * <p>Returns the roles that can invoke the given operation. This is determined
by matching the
      * operation details against configuration provided.</p>
@@ -93,9 +101,13 @@ public class ACLConfigurationParser {
         if (roles != null) {
             addToRoles.addAll(roles);
             return Specificity.WILDCARD_MATCH;
+        } else if (compulsoryRoles != null){
+            addToRoles.addAll(ACLConfigurationParser.parseRoles(compulsoryRoles));
+            return Specificity.NAME_MATCH;
         } else {
             return Specificity.NO_MATCH;
         }
+            
     }
 
     private static Specificity getRolesBasedOnSignature(String methodName, Object[] params,
String[] signature,


Mime
View raw message