Results 1 to 2 of 2

Thread: DefaultAdvisorAutoProxyCreator and MethodDefinitionSourceAdvisor

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Default DefaultAdvisorAutoProxyCreator and MethodDefinitionSourceAdvisor

    I'm trying to implement some code such that the authorization depends on the filename and on the method. So my application context looks like

    Code:
    	<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
    		<property name="authenticationManager" ref="authenticationManager" />
    		<property name="accessDecisionManager">
    			<bean class="org.acegisecurity.vote.AffirmativeBased">
    				<property name="allowIfAllAbstainDecisions" value="false" />
    				<property name="decisionVoters">
    					<list>
    						<bean class="org.acegisecurity.vote.RoleVoter" />
    						<bean class="org.acegisecurity.vote.AuthenticatedVoter" />
    					</list>
    				</property>
    			</bean>
    		</property>
    		<property name="objectDefinitionSource">
    			<value>
    				<![CDATA[
    				CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
    				PATTERN_TYPE_APACHE_ANT
    				/logout.*=IS_AUTHENTICATED_ANONYMOUSLY
    				/**=ROLE_USER
    				]]>
    			</value>
    		</property>
    	</bean>
    and

    Code:
    	<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>
    	<bean class="org.acegisecurity.intercept.method.aopalliance.MethodDefinitionSourceAdvisor">
    	    <constructor-arg>
            	<ref bean="myMethodInterceptor"/>
        	</constructor-arg>
    	</bean>
    	
    	<bean id="myMethodInterceptor" class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
    		<property name="validateConfigAttributes" value="false"/>
    		<property name="authenticationManager" ref="authenticationManager"/>
    		<property name="accessDecisionManager">
    			<bean class="org.acegisecurity.vote.AffirmativeBased">
    				<property name="allowIfAllAbstainDecisions" value="false" />
    				<property name="decisionVoters">
    					<list>
    						<bean class="org.acegisecurity.vote.RoleVoter" />
    						<bean class="org.acegisecurity.vote.AuthenticatedVoter" />
    					</list>
    				</property>
    			</bean>
    		</property>
    		<property name="objectDefinitionSource">
    			<value>
    				org.bla.MyClass.*=ROLE_ADMINISTRATOR
    			</value>
    		</property> 
    	</bean>
    My problem is that Acegi Security seems to not beeing very interested in the second block of statements.

    Can anyone help me?

    Thanks
    Sabata

    P.S.: I'm a totally newbie.

  2. #2
    Join Date
    Apr 2009
    Posts
    2

    Angry

    I tried BeanNameAutoProxyCreator instead of MethodDefinitionSourceAdvisor but this didn't worked, too. I don't know why. All examples do it in this way, but my code doesn't work. myMethodInterceptor does not appear in the log (debug level). And there is no warning or error about this. Has anyone an idea?

    Thanks
    Sabata

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •