improved WallFilter config. issue #1426

This commit is contained in:
wenshao
2016-09-25 02:11:43 +08:00
parent 301e339376
commit 2e478b1869
2 changed files with 27 additions and 15 deletions
@@ -94,6 +94,12 @@ public class DruidDataSourceFactory implements ObjectFactory {
"druid.maxWaitThreadCount", //
"druid.failFast", //
"druid.phyTimeoutMillis", //
"druid.wall.tenantColumn", //
"druid.wall.updateAllow", //
"druid.wall.deleteAllow", //
"druid.wall.insertAllow", //
"druid.wall.selelctAllow", //
"druid.wall.multiStatementAllow", //
};
@Override
@@ -791,33 +791,39 @@ public class WallConfig implements WallConfigMBean {
public void configFromProperties(Properties properties) {
{
String tenantColumn = properties.getProperty("druid.wall.tenantColumn");
if (tenantColumn != null) {
this.setTenantColumn(tenantColumn);
String propertyValue = properties.getProperty("druid.wall.tenantColumn");
if (propertyValue != null) {
this.setTenantColumn(propertyValue);
}
}
{
Boolean selelctAllow = getBoolean(properties, "druid.wall.selelctAllow");
if (selelctAllow != null) {
this.setSelelctAllow(selelctAllow);
Boolean propertyValue = getBoolean(properties, "druid.wall.selelctAllow");
if (propertyValue != null) {
this.setSelelctAllow(propertyValue);
}
}
{
Boolean updateAllow = getBoolean(properties, "druid.wall.updateAllow");
if (updateAllow != null) {
this.setUpdateAllow(updateAllow);
Boolean propertyValue = getBoolean(properties, "druid.wall.updateAllow");
if (propertyValue != null) {
this.setUpdateAllow(propertyValue);
}
}
{
Boolean deleteAllow = getBoolean(properties, "druid.wall.deleteAllow");
if (deleteAllow != null) {
this.setDeleteAllow(deleteAllow);
Boolean propertyValue = getBoolean(properties, "druid.wall.deleteAllow");
if (propertyValue != null) {
this.setDeleteAllow(propertyValue);
}
}
{
Boolean insertAllow = getBoolean(properties, "druid.wall.insertAllow");
if (insertAllow != null) {
this.setInsertAllow(insertAllow);
Boolean propertyValue = getBoolean(properties, "druid.wall.insertAllow");
if (propertyValue != null) {
this.setInsertAllow(propertyValue);
}
}
{
Boolean propertyValue = getBoolean(properties, "druid.wall.multiStatementAllow");
if (propertyValue != null) {
this.setMultiStatementAllow(propertyValue);
}
}
}