This commit is contained in:
Ray.Hao
2024-05-09 14:11:06 +08:00

View File

@@ -32,12 +32,12 @@ public class MyDataPermissionHandler implements DataPermissionHandler {
String methodName = mappedStatementId.substring(mappedStatementId.lastIndexOf(StringPool.DOT) + 1);
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
if (method.getName().equals(methodName)) {
DataPermission annotation = method.getAnnotation(DataPermission.class);
// 如果没有注解或者是超级管理员,直接返回
if (annotation == null || SecurityUtils.isRoot()) {
if (annotation == null || SecurityUtils.isRoot() ) {
return where;
}
if (method.getName().equals(methodName) || (method.getName() + "_COUNT").equals(methodName)) {
return dataScopeFilter(annotation.deptAlias(), annotation.deptIdColumnName(), annotation.userAlias(), annotation.userIdColumnName(), where);
}
}