Skip to content

Commit

Permalink
feat-ISelectAbility-修正view单条接口某些情况下可以突破权限限制的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Nov 12, 2024
1 parent 76d0439 commit 6e92276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ public boolean isAuthorized(ApiRequest request) {
request.setError(permsException1);
return false;
}
} else if ("view".equals(action)) {
}

if ("view".equals(action)) {
String condition = getAuthCondition(userID, request.getModule(), action);
request.setAuthCondition(condition);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ default List<SortColumn> getSortDefaultColumns() {
}

default String getSelectOneRowSql() {
return "select * from (%s) %s where %s = :id ".formatted(getSelectSql(), getMainTable(), getPK());
return "select * from (%s) %s where 1=1 %s and %s = :id ".formatted(getSelectSql(), getMainTable(), getAuthCondition(), getPK());
}

default String getSelectSql() {
Expand Down

0 comments on commit 6e92276

Please sign in to comment.