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:
[email protected]


With regards,
Apache Git Services

Reply via email to