diff --git a/acl/src/main/java/org/apache/rocketmq/acl/common/Permission.java b/acl/src/main/java/org/apache/rocketmq/acl/common/Permission.java index 38649b08327..27fac59d585 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/common/Permission.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/common/Permission.java @@ -43,6 +43,14 @@ public class Permission { ADMIN_CODE.add(RequestCode.UPDATE_AND_CREATE_SUBSCRIPTIONGROUP); // DELETE_SUBSCRIPTIONGROUP ADMIN_CODE.add(RequestCode.DELETE_SUBSCRIPTIONGROUP); + // UPDATE_AND_CREATE_STATIC_TOPIC + ADMIN_CODE.add(RequestCode.UPDATE_AND_CREATE_STATIC_TOPIC); + // UPDATE_AND_CREATE_ACL_CONFIG + ADMIN_CODE.add(RequestCode.UPDATE_AND_CREATE_ACL_CONFIG); + // DELETE_ACL_CONFIG + ADMIN_CODE.add(RequestCode.DELETE_ACL_CONFIG); + // GET_BROKER_CLUSTER_ACL_INFO + ADMIN_CODE.add(RequestCode.GET_BROKER_CLUSTER_ACL_INFO); } public static boolean checkPermission(byte neededPerm, byte ownedPerm) { diff --git a/acl/src/test/java/org/apache/rocketmq/acl/common/PermissionTest.java b/acl/src/test/java/org/apache/rocketmq/acl/common/PermissionTest.java index 8fd8052c8a4..39ddbd3eea6 100644 --- a/acl/src/test/java/org/apache/rocketmq/acl/common/PermissionTest.java +++ b/acl/src/test/java/org/apache/rocketmq/acl/common/PermissionTest.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.Set; import org.apache.rocketmq.acl.plain.PlainAccessResource; +import org.apache.rocketmq.remoting.protocol.RequestCode; import org.junit.Assert; import org.junit.Test; @@ -141,11 +142,15 @@ public void setTopicPermTest() { @Test public void checkAdminCodeTest() { Set code = new HashSet<>(); - code.add(17); - code.add(25); - code.add(215); - code.add(200); - code.add(207); + code.add(RequestCode.UPDATE_AND_CREATE_TOPIC); + code.add(RequestCode.UPDATE_BROKER_CONFIG); + code.add(RequestCode.DELETE_TOPIC_IN_BROKER); + code.add(RequestCode.UPDATE_AND_CREATE_SUBSCRIPTIONGROUP); + code.add(RequestCode.DELETE_SUBSCRIPTIONGROUP); + code.add(RequestCode.UPDATE_AND_CREATE_STATIC_TOPIC); + code.add(RequestCode.UPDATE_AND_CREATE_ACL_CONFIG); + code.add(RequestCode.DELETE_ACL_CONFIG); + code.add(RequestCode.GET_BROKER_CLUSTER_ACL_INFO); for (int i = 0; i < 400; i++) { boolean boo = Permission.needAdminPerm(i);