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 0acc8e9508138f3db3ae508dd5f78cd4a10011a2..8ceb135fbf1f3f5fc07a83f68a981c22780d0506 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 @@ -65,7 +65,6 @@ public class Permission { case "SUB": return Permission.SUB; case "PUB|SUB": - return Permission.PUB | Permission.SUB; case "SUB|PUB": return Permission.PUB | Permission.SUB; case "DENY": diff --git a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java index 89638f6ac2cdcc818537887fb77851cdb16f0b1e..c182d7eb6a44fa7364542102471479b0fb25d86c 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java @@ -73,7 +73,7 @@ public class PlainPermissionManager { JSONObject plainAclConfData = AclUtils.getYamlDataObject(fileHome + File.separator + fileName, JSONObject.class); if (plainAclConfData == null || plainAclConfData.isEmpty()) { - throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); + throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); } log.info("Broker plain acl conf data is : ", plainAclConfData.toString()); JSONArray globalWhiteRemoteAddressesList = plainAclConfData.getJSONArray("globalWhiteRemoteAddresses"); @@ -164,14 +164,13 @@ public class PlainPermissionManager { return false; } - private Map createAclAccessConfigMap(Map existedAccoutMap, PlainAccessConfig plainAccessConfig) { - - + private Map createAclAccessConfigMap(Map existedAccountMap, PlainAccessConfig plainAccessConfig) { + Map newAccountsMap = null; - if (existedAccoutMap == null) { + if (existedAccountMap == null) { newAccountsMap = new LinkedHashMap(); } else { - newAccountsMap = existedAccoutMap; + newAccountsMap = existedAccountMap; } if (StringUtils.isEmpty(plainAccessConfig.getAccessKey()) || @@ -278,7 +277,7 @@ public class PlainPermissionManager { JSONObject plainAclConfData = AclUtils.getYamlDataObject(fileHome + File.separator + fileName, JSONObject.class); if (plainAclConfData == null || plainAclConfData.isEmpty()) { - throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); + throw new AclException(String.format("%s file is not data", fileHome + File.separator + fileName)); } JSONArray globalWhiteAddrs = plainAclConfData.getJSONArray(AclConstants.CONFIG_GLOBAL_WHITE_ADDRS); if (globalWhiteAddrs != null && !globalWhiteAddrs.isEmpty()) {