提交 44e2669a 编写于 作者: Z zhangjidi2016

[ISSUE #3128] fix the delete global white addresses

上级 3183122c
...@@ -251,12 +251,6 @@ public class PlainPermissionManager { ...@@ -251,12 +251,6 @@ public class PlainPermissionManager {
} }
public boolean updateGlobalWhiteAddrsConfig(List<String> globalWhiteAddrsList) { public boolean updateGlobalWhiteAddrsConfig(List<String> globalWhiteAddrsList) {
if (globalWhiteAddrsList == null) {
log.error("Parameter value globalWhiteAddrsList is null,Please check your parameter");
return false;
}
Map<String, Object> aclAccessConfigMap = AclUtils.getYamlDataObject(fileHome + File.separator + fileName, Map<String, Object> aclAccessConfigMap = AclUtils.getYamlDataObject(fileHome + File.separator + fileName,
Map.class); Map.class);
if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) { if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) {
...@@ -266,9 +260,10 @@ public class PlainPermissionManager { ...@@ -266,9 +260,10 @@ public class PlainPermissionManager {
if (globalWhiteRemoteAddrList != null) { if (globalWhiteRemoteAddrList != null) {
globalWhiteRemoteAddrList.clear(); globalWhiteRemoteAddrList.clear();
globalWhiteRemoteAddrList.addAll(globalWhiteAddrsList); if (globalWhiteAddrsList != null) {
globalWhiteRemoteAddrList.addAll(globalWhiteAddrsList);
// Update globalWhiteRemoteAddr element in memeory map firstly }
// Update globalWhiteRemoteAddr element in memory map firstly
aclAccessConfigMap.put(AclConstants.CONFIG_GLOBAL_WHITE_ADDRS, globalWhiteRemoteAddrList); aclAccessConfigMap.put(AclConstants.CONFIG_GLOBAL_WHITE_ADDRS, globalWhiteRemoteAddrList);
if (AclUtils.writeDataObject(fileHome + File.separator + fileName, updateAclConfigFileVersion(aclAccessConfigMap))) { if (AclUtils.writeDataObject(fileHome + File.separator + fileName, updateAclConfigFileVersion(aclAccessConfigMap))) {
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册