From 6e92276fc10ecd9da427308a038fff2536181d9c Mon Sep 17 00:00:00 2001 From: Liu Rui Date: Tue, 12 Nov 2024 10:32:14 +0800 Subject: [PATCH] =?UTF-8?q?feat-ISelectAbility-=E4=BF=AE=E6=AD=A3view?= =?UTF-8?q?=E5=8D=95=E6=9D=A1=E6=8E=A5=E5=8F=A3=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E5=8F=AF=E4=BB=A5=E7=AA=81=E7=A0=B4=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=99=90=E5=88=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/ximatai/muyun/authorization/AuthorizationService.java | 4 +++- .../net/ximatai/muyun/ability/curd/std/ISelectAbility.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/muyun-authorization/src/main/java/net/ximatai/muyun/authorization/AuthorizationService.java b/muyun-authorization/src/main/java/net/ximatai/muyun/authorization/AuthorizationService.java index f9c2052..e6531a0 100644 --- a/muyun-authorization/src/main/java/net/ximatai/muyun/authorization/AuthorizationService.java +++ b/muyun-authorization/src/main/java/net/ximatai/muyun/authorization/AuthorizationService.java @@ -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); } diff --git a/muyun-core/src/main/java/net/ximatai/muyun/ability/curd/std/ISelectAbility.java b/muyun-core/src/main/java/net/ximatai/muyun/ability/curd/std/ISelectAbility.java index 9189a51..bf676bf 100644 --- a/muyun-core/src/main/java/net/ximatai/muyun/ability/curd/std/ISelectAbility.java +++ b/muyun-core/src/main/java/net/ximatai/muyun/ability/curd/std/ISelectAbility.java @@ -61,7 +61,7 @@ default List 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() {