SEC-1213: Enhance Security Config Schema and GlobalMethodSecurityBeanDefinitionParser to allow for "Order" to be set on the MethodSecurityMetadataSourceAdvisor. #1465

spring-issuemaster opened this Issue Jul 31, 2009 · 2 comments


None yet

1 participant


Shawn Stephens (Migrated from SEC-1213) said:

I am currently must manually configure Spring Security and cannot make use of the simply because I need to set the "Order" property on MethodSecurityMetadataSourceAdvisor when it is created. I need this because I have several aspects which make use of the ability of Spring AOP's Ordering feature on my Service classes. This simple oversight results in going from a few lines of xml to tens of lines of manually configured Spring Security xml. An xml attribute would do.

   <!-- I want to do this, notice the order="40" attribute-->
  <global-method-security secured-annotations="enabled" jsr250-annotations="enabled" order="40" /> 

The current GlobalMethodSecurityBeanDefinitionParser doesn't allow for the "Order" property to be set:

    private void registerAdvisor(ParserContext parserContext, Object source) {
        RootBeanDefinition advisor = new RootBeanDefinition(MethodSecurityMetadataSourceAdvisor.class);
        advisor.getConstructorArgumentValues().addGenericArgumentValue(new RuntimeBeanReference(DELEGATING_METHOD_DEFINITION_SOURCE_ID));

         // I need the Order property set here to order the Advice.

        parserContext.getRegistry().registerBeanDefinition(BeanIds.METHOD_SECURITY_METADATA_SOURCE_ADVISOR, advisor);


Luke Taylor said:

I've added an "order" attribute to global-method-security.


Shawn Stephens said:

You rock! Thanks a ton.

@spring-issuemaster spring-issuemaster added this to the 3.0.0 RC1 milestone Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment