Jun 1st, 2009, 12:48 PM
ordering security, transaction and other advices (AOP)
sorry if this question has been asked before:
I try to implement method based security with global-method-security:
<protect-pointcut expression="execution(* com.mycompany.*Service.*(..))" access="ROLE_USER"/>
The services are also tranactional via XML-defined AOP advisors.
Last but not least there are some custom advices defined for some service methods.
Now I want to order these advices such that first the transaction starts, then the security checks are performed and after that my custom advices.
What's the best/recommended way to achieve this?
(While I can specify ordering info on the transaction and custom advices, I don't see an order-attribute on global-method-security or protect-pointcut)
Thanks for your help,
Jun 23rd, 2009, 12:21 AM
I too am searching for this answer. I came across this post. I need to be able to use order="20" or something similar like I use in the tx:annotation-driven tag.
Did you figure this out? Anyone else have the answer?
Jun 27th, 2009, 10:03 AM
Unfortunately, I had to revert to the traditional style of configuring the method security interceptor and advisor to be able to specify the ordering.
It would be very useful to support ordering with global-method-security, wouldn't it?
Jun 29th, 2009, 09:35 PM
Yes, it would be very helpful if Spring simply took an order property and passed that to the MethodDefinitionSourceAdvisor.
Originally Posted by hbrands
Would you mind posting your configuration for reference in this thread? Alternatively, can you point me to the reference for the "traditional style" that you mention.