Hi All,
I'm trying to use Spring Security to do authorization, and through the JSR-250 annotations. I need to create a before advice where the pointcut would be the RolesAllowed annotation (for any method annotated with it).
I've been going through what examples I have found on the web so far, but to no avail:
Note: I'm replacing the (at) symbol for annotations to # because I don't have 15 posts yet and it's interpreting them as URLs
and the method...Code:#Before("execution(#javax.annotation.security.RolesAllowed * *.*(..))") //#Before("execution(* *.*(..)) && #annotation(javax.annotation.security.RolesAllowed)") public void authenticate(){ System.out.println("In authentication advice"); }
Thanks in advance for any help!Code:#RolesAllowed( {"ROLE_OPERATOR"} ) public String doSomething(String input) { return input; }


Reply With Quote