mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-05-23 00:58:26 +00:00
fix(DataScopeHandler):Fixed the processing logic of data permission scopes
This commit is contained in:
parent
3f452579e5
commit
0b86e77bc6
1 changed files with 7 additions and 5 deletions
|
|
@ -91,7 +91,7 @@ public class DataScopeHandler implements MultiDataPermissionHandler {
|
|||
finalExpression = equalsTo;
|
||||
}
|
||||
|
||||
if (scopeOption.isDepartmentList()) {
|
||||
if (scopeOption.isUserList()) {
|
||||
PlainSelect plainSelect = new PlainSelect();
|
||||
plainSelect.addSelectItems(new SelectItem<>(new StringValue("1")));
|
||||
|
||||
|
|
@ -103,12 +103,13 @@ public class DataScopeHandler implements MultiDataPermissionHandler {
|
|||
joinCondition.setRightExpression(new Column(table, "id"));
|
||||
|
||||
EqualsTo equalsTo = new EqualsTo();
|
||||
joinCondition.setLeftExpression(new Column(subTable, scopeOption.getUserListJoinColumnName()));
|
||||
joinCondition.setRightExpression(new StringValue(userId));
|
||||
equalsTo.setLeftExpression(new Column(subTable, scopeOption.getUserListInverseJoinColumnName()));
|
||||
equalsTo.setRightExpression(new StringValue(userId));
|
||||
|
||||
plainSelect.setWhere(new AndExpression(joinCondition, equalsTo));
|
||||
|
||||
ParenthesedSelect parenthesedSelect = new ParenthesedSelect(plainSelect);
|
||||
ParenthesedSelect parenthesedSelect = new ParenthesedSelect();
|
||||
parenthesedSelect.setSelect(plainSelect);
|
||||
ExistsExpression existsExpression = new ExistsExpression();
|
||||
existsExpression.setRightExpression(parenthesedSelect);
|
||||
|
||||
|
|
@ -155,7 +156,8 @@ public class DataScopeHandler implements MultiDataPermissionHandler {
|
|||
|
||||
plainSelect.setWhere(new AndExpression(joinCondition, inCondition));
|
||||
|
||||
ParenthesedSelect parenthesedSelect = new ParenthesedSelect(plainSelect);
|
||||
ParenthesedSelect parenthesedSelect = new ParenthesedSelect();
|
||||
parenthesedSelect.setSelect(plainSelect);
|
||||
ExistsExpression existsExpression = new ExistsExpression();
|
||||
existsExpression.setRightExpression(parenthesedSelect);
|
||||
finalExpression = finalExpression == null ? existsExpression : new AndExpression(finalExpression, existsExpression);
|
||||
|
|
|
|||
Loading…
Reference in a new issue