/* Copyright 2006-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Grails Acegi Security Plugin * * @author T.Yamamoto * */ class AcegiGrailsPlugin { def version = 0.1 def dependsOn = [:] def configExist = false def doWithSpring = { def cf={field-> return "get"+field[0].toUpperCase()+field[1.. // TODO Implement post initialization spring config (optional) } def doWithWebDescriptor = {webXml -> /** TODO: Check can use acegi or not def conf = application.getController("LoginController").newInstance() if(conf!=null){ println conf.loadMessage _go=true }else{ println "Acegi on Grails Configurations are not loaded..." }*/ configExist=true if(configExist){ def contextParam = webXml."context-param" contextParam[contextParam.size()-1]+{ 'filter' { //'filter-name'('acegiAuthenticationProcessingFilter') //'filter-class'('org.acegisecurity.util.FilterToBeanProxy') 'filter-name'('filterChainProxy') 'filter-class'('org.springframework.web.filter.DelegatingFilterProxy') 'init-param'{ 'param-name'('targetClass') 'param-value'('org.acegisecurity.util.FilterChainProxy') } } } def filter = webXml."filter" filter[filter.size()-1]+{ 'filter-mapping'{ //'filter-name'('acegiAuthenticationProcessingFilter') 'filter-name'('filterChainProxy') 'url-pattern'("/*") } } } } def onChange = { event -> } def onApplicationChange = { event -> } }