From 587cc57a3311e2c09db7c79f3c0d519a0952fb2e Mon Sep 17 00:00:00 2001 From: zhou-hao Date: Fri, 24 Nov 2017 18:04:05 +0800 Subject: [PATCH] + Authorize --- .../web/authorization/basic/aop/AopAuthorizingController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/AopAuthorizingController.java b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/AopAuthorizingController.java index 191cbed87..bed5917c1 100644 --- a/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/AopAuthorizingController.java +++ b/hsweb-authorization/hsweb-authorization-basic/src/main/java/org/hswebframework/web/authorization/basic/aop/AopAuthorizingController.java @@ -3,6 +3,7 @@ package org.hswebframework.web.authorization.basic.aop; import org.aopalliance.intercept.MethodInterceptor; import org.hswebframework.web.AopUtils; import org.hswebframework.web.authorization.Authentication; +import org.hswebframework.web.authorization.annotation.Authorize; import org.hswebframework.web.authorization.define.AuthorizingContext; import org.hswebframework.web.authorization.basic.handler.AuthorizingHandler; import org.hswebframework.web.authorization.define.AuthorizeDefinition; @@ -48,6 +49,7 @@ public class AopAuthorizingController extends StaticMethodMatcherPointcutAdvisor public boolean matches(Method method, Class aClass) { //对controller进行控制 return AopUtils.findAnnotation(aClass, Controller.class) != null - || AopUtils.findAnnotation(aClass, RestController.class) != null; + || AopUtils.findAnnotation(aClass, RestController.class) != null + || AopUtils.findAnnotation(aClass, method, Authorize.class) != null; } }