数据权限bugfix

pull/51/head
yinli 2023-08-22 17:46:49 +08:00
parent 6dad9456e3
commit 09d4d56304
1 changed files with 3 additions and 0 deletions

View File

@ -507,6 +507,9 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
// 单条规则的条件 // 单条规则的条件
String tableName = MyBatisUtils.getTableName(table); String tableName = MyBatisUtils.getTableName(table);
Expression oneExpress = rule.getExpression(tableName, table.getAlias()); Expression oneExpress = rule.getExpression(tableName, table.getAlias());
if(oneExpress == null){
continue;
}
// 拼接到 allExpression 中 // 拼接到 allExpression 中
allExpression = allExpression == null ? oneExpress allExpression = allExpression == null ? oneExpress
: new AndExpression(allExpression, oneExpress); : new AndExpression(allExpression, oneExpress);