Skip to content

Commit 7485db4

Browse files
committed
新增merge属性,方法注解可不与类上的合并
1 parent a9b6151 commit 7485db4

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

hsweb-web-core/src/main/java/org/hsweb/web/core/authorize/AopAuthorizeValidator.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
import java.util.concurrent.ConcurrentHashMap;
2525
import java.util.concurrent.ConcurrentMap;
2626

27-
/**
28-
* Created by zhouhao on 16-4-28.
29-
*/
3027
public class AopAuthorizeValidator extends SimpleAuthorizeValidator {
3128

3229
private HttpSessionManager httpSessionManager;
@@ -57,7 +54,7 @@ protected AuthorizeValidatorConfig getConfig(ProceedingJoinPoint pjp) {
5754
return null;
5855
}
5956
Set<Authorize> authorizes = new LinkedHashSet<>();
60-
if (classAuth != null) {
57+
if (classAuth != null && (methodAuth == null || methodAuth.merge())) {
6158
if (classAuth.anonymous()) return null;
6259
authorizes.add(classAuth);
6360
}

hsweb-web-core/src/main/java/org/hsweb/web/core/authorize/annotation/Authorize.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,18 @@
5656

5757
/**
5858
* 可匿名访问
59-
* @return 是否可匿名访问,匿名访问将不用登录
59+
*
60+
* @return 是否可匿名访问, 匿名访问将不用登录
6061
*/
6162
boolean anonymous() default false;
63+
64+
/**
65+
* 是否合并类上的注解
66+
*
67+
* @return 是否合并类上的注解
68+
*/
69+
boolean merge() default true;
70+
6271
/**
6372
* 验证模式,在使用多个验证条件时有效
6473
*

0 commit comments

Comments
 (0)