You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/12/10 09:16:20 UTC

[GitHub] dongeforever commented on a change in pull request #595: Enhanced communication installation

dongeforever commented on a change in pull request #595: Enhanced communication installation
URL: https://github.com/apache/rocketmq/pull/595#discussion_r240129105
 
 

 ##########
 File path: acl/src/main/java/org/apache/rocketmq/acl/common/Permission.java
 ##########
 @@ -17,4 +54,43 @@ public boolean checkPermission(byte neededPerm, byte ownedPerm) {
         return (neededPerm & ownedPerm) > 0;
     }
 
+    public static byte fromStringGetPermission(String permString) {
+        if (permString == null) {
+            return Permission.DENY;
+        }
+        switch (permString.trim()) {
+            case "PUB":
+                return Permission.PUB;
+            case "SUB":
+                return Permission.SUB;
+            case "ANY":
+                return Permission.ANY;
+            case "PUB|SUB":
+                return Permission.ANY;
+            case "SUB|PUB":
+                return Permission.ANY;
+            case "DENY":
+                return Permission.DENY;
+            default:
+                return Permission.DENY;
+        }
+    }
+
+    public static void setTopicPerm(PlainAccessResource plainAccessResource, Boolean isTopic, JSONArray topicArray) {
 
 Review comment:
   Use map instead of JSONArray

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services