Skip to content

Commit b750706

Browse files
committed
update version to add skipDataAuthorization void method
1 parent eb7e466 commit b750706

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<groupId>com.codingapi.springboot</groupId>
1717
<artifactId>springboot-parent</artifactId>
18-
<version>2.9.33</version>
18+
<version>2.9.34</version>
1919

2020
<url>https://github.com/codingapi/springboot-framewrok</url>
2121
<name>springboot-parent</name>

springboot-starter-data-authorization/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.9.33</version>
9+
<version>2.9.34</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-data-authorization</artifactId>

springboot-starter-data-authorization/src/main/java/com/codingapi/springboot/authorization/interceptor/SQLRunningContext.java

+17-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import lombok.Getter;
44

55
import java.sql.SQLException;
6+
import java.util.function.Supplier;
67

78
/**
89
* SQLRunningContext SQL执行拦截上下文
@@ -55,7 +56,7 @@ public SQLInterceptState intercept(String sql) throws SQLException {
5556
* @param <T> T
5657
* @return T
5758
*/
58-
public <T> T skipDataAuthorization(java.util.function.Supplier<T> supplier) {
59+
public <T> T skipDataAuthorization(Supplier<T> supplier) {
5960
try {
6061
skipInterceptor.set(true);
6162
return (T) supplier.get();
@@ -64,4 +65,19 @@ public <T> T skipDataAuthorization(java.util.function.Supplier<T> supplier) {
6465
}
6566
}
6667

68+
69+
/**
70+
* 跳过数据权限拦截
71+
*
72+
* @param runnable 业务逻辑
73+
*/
74+
public void skipDataAuthorization(Runnable runnable) {
75+
try {
76+
skipInterceptor.set(true);
77+
runnable.run();
78+
} finally {
79+
skipInterceptor.set(false);
80+
}
81+
}
82+
6783
}

springboot-starter-data-fast/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>springboot-parent</artifactId>
77
<groupId>com.codingapi.springboot</groupId>
8-
<version>2.9.33</version>
8+
<version>2.9.34</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

springboot-starter-flow/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.9.33</version>
9+
<version>2.9.34</version>
1010
</parent>
1111

1212
<name>springboot-starter-flow</name>

springboot-starter-security/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>springboot-parent</artifactId>
88
<groupId>com.codingapi.springboot</groupId>
9-
<version>2.9.33</version>
9+
<version>2.9.34</version>
1010
</parent>
1111

1212
<artifactId>springboot-starter-security</artifactId>

springboot-starter/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.codingapi.springboot</groupId>
77
<artifactId>springboot-parent</artifactId>
8-
<version>2.9.33</version>
8+
<version>2.9.34</version>
99
</parent>
1010
<artifactId>springboot-starter</artifactId>
1111

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
------------------------------------------------------
2-
CodingApi SpringBoot-Starter 2.9.33
2+
CodingApi SpringBoot-Starter 2.9.34
33
springboot version (${spring-boot.version})
44
------------------------------------------------------

0 commit comments

Comments
 (0)