|
24 | 24 | import org.aspectj.lang.annotation.Pointcut; |
25 | 25 |
|
26 | 26 | /** |
27 | | - * Aspect that adds a before advice for each invocation of an annotated method. |
| 27 | + * Aspect that adds a before advice for each invocation of an annotated method or class. |
28 | 28 | */ |
29 | | -@Aspect() |
| 29 | +@Aspect |
30 | 30 | public class ShiroAnnotationAuthorizingAspect { |
31 | 31 |
|
32 | | - private static final String pointCupExpression = |
| 32 | + private static final String pointCutExpression = |
33 | 33 | "execution(@org.apache.shiro.authz.annotation.RequiresAuthentication * *(..)) || " + |
| 34 | + "execution(* (@org.apache.shiro.authz.annotation.RequiresAuthentication *).*(..)) || " + |
34 | 35 | "execution(@org.apache.shiro.authz.annotation.RequiresGuest * *(..)) || " + |
| 36 | + "execution(* (@org.apache.shiro.authz.annotation.RequiresGuest *).*(..)) || " + |
35 | 37 | "execution(@org.apache.shiro.authz.annotation.RequiresPermissions * *(..)) || " + |
| 38 | + "execution(* (@org.apache.shiro.authz.annotation.RequiresPermissions *).*(..)) || " + |
36 | 39 | "execution(@org.apache.shiro.authz.annotation.RequiresRoles * *(..)) || " + |
37 | | - "execution(@org.apache.shiro.authz.annotation.RequiresUser * *(..))"; |
| 40 | + "execution(* (@org.apache.shiro.authz.annotation.RequiresRoles *).*(..)) || " + |
| 41 | + "execution(@org.apache.shiro.authz.annotation.RequiresUser * *(..)) || " + |
| 42 | + "execution(* (@org.apache.shiro.authz.annotation.RequiresUser *).*(..))"; |
38 | 43 |
|
39 | | - @Pointcut(pointCupExpression) |
| 44 | + @Pointcut(pointCutExpression) |
40 | 45 | public void anyShiroAnnotatedMethod() { |
41 | 46 | } |
42 | 47 |
|
43 | | - @Pointcut(pointCupExpression) |
| 48 | + @Pointcut(pointCutExpression) |
44 | 49 | void anyShiroAnnotatedMethodCall(JoinPoint thisJoinPoint) { |
45 | 50 | } |
46 | 51 |
|
|
0 commit comments