
Originally Posted by
tmoens
If you happened to use the flex add-on for Roo to generate your services, all the methods are in the .aj files which are generated and you can not edit them (without losing the edits) and therefore you cannot annotate the methods with @Secured. Too bad. This is when you really read section 5.3.3 and learn how to put <protect-pointcut>... in your security context file.
Keep in mind that you are free to implement any of the Roo-generated methods yourself in the actual .java file for the service, i.e., in Roo vernacular, you "take control" of that method. The easiest way to do that is to use STS's push-in refactoring feature. At that point, you should be able to add a @Secured annotation as necessary.
That said, I can see how it would be nice to have a way to indicate security permissions on one of these methods without having to take control of it. I've gone ahead and created a Jira to capture that:
https://jira.springframework.org/browse/ROOFLEX-21
Feel free to comment there with any additional insights on how you'd like it to work.
Jeremy Grelle
Staff Engineer, Web Products Team
SpringSource