Hi,
I have the following problem:
I have create annotation for Security:
I am now annotating classes and methods with this annotation. In some cases the class is annotated with this annotation and specific method within this class is also annotated with @Security with different roles.Code:@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) @Inherited @Documented public @interface Security { Role[] roles(); }
How can create @Before advice that will catch either methods annotated with @Security ot methods within classes annotated with @Security, and also to get the more specific definition in case there are annotation on both the class and method.
I obviously need also the content of the annotation as well (the roles).
Is it possible?
Is it also possible in cases that I have inhertience between classes that all of them have the @Security annotation to get the most specific definition?
Yosi


Reply With Quote
