atom feed6 messages in org.codehaus.grails.dev[grails-dev] Aspect configuration in ...
FromSent OnAttachments
Sebastien ARBOGASTApr 15, 2010 3:39 pm 
Sebastien ARBOGASTApr 17, 2010 6:39 am 
Stephane MaldiniApr 17, 2010 10:31 am 
Sebastien ARBOGASTApr 17, 2010 11:25 am 
Sebastien ARBOGASTApr 18, 2010 3:20 am 
Sebastien ARBOGASTApr 18, 2010 3:30 am 
Subject:[grails-dev] Aspect configuration in plugin
From:Sebastien ARBOGAST (seba@gmail.com)
Date:Apr 15, 2010 3:39:18 pm
List:org.codehaus.grails.dev

I'm trying to configure an aspect from within a plugin that I'm writing. Until now, I had the AOP configuration in grails-app/conf/spring/resources.groovy and it worked fine:

import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter import org.epseelon.grails.blazeds.security.AuthorizationAspect

beans = { xmlns aop: "http://www.springframework.org/schema/aop" securityAspect(AuthorizationAspect) aop { config("proxy-target-class": true) { aspect(id: 'theSecurityAspectDef', ref: 'securityAspect') { around method: "invoke", pointcut: "@annotation(secured)", "arg-names": "secured" } } } }

But when I try to move this very same declaration in the plugin descriptor, the aspect is simply ignored:

def doWithSpring = { xmlns aop: "http://www.springframework.org/schema/aop" securityAspect(AuthorizationAspect) aop { config("proxy-target-class": true) { aspect(id: 'theSecurityAspectDef', ref: 'securityAspect') { around method: "invoke", pointcut: "@annotation(secured)", "arg-names": "secured" } } } }

Can someone help me figure out what I'm missing here? What am I doing wrong?