Results 1 to 5 of 5

Thread: pre-post-annotations and PropertyConfigurer. Schema too strict?

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Default pre-post-annotations and PropertyConfigurer. Schema too strict?

    Hi,

    I would like to configure the pre-post-annotations via a property like this

    Code:
    <security:global-method-security pre-post-annotations="${security.annotations}"/>
    using security.annotations=enabled

    However, I'm getting the following error:

    Code:
    Offending resource: class path resource resteasy-test-server.xml; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 24 in XML document from class path resource resteasy-service-servlet.xml is invalid; nested exception is org.xml.sax.SAXParseException: cvc-enumeration-valid: Value '${security.annotations}' is not facet-valid with respect to enumeration '[disabled, enabled]'. It must be a value from the enumeration.
    The motivation is to disable the security for testing. For my tests I'm including my regular appContext.xml files and having the above configuration once with enabled and once with disabled doesn't work.

    Frank

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    You might consider adding an enhancement request to JIRA. In the meantime, you could disable security by writing a SecurityExpressionHandler that wraps the current one and can be disabled use a boolean property.
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3
    Join Date
    Sep 2004
    Location
    Manchester, NH
    Posts
    1,236

    Default

    Looking at the source, I think this doesn't work because these properties don't get set directly on a BeanDefinitionSource. Let us know if you want help filing a JIRA, as Rob said, this is an enhancement that Luke has applied to most other areas of the config where attributes directly translate to beans, but in this area it'll require some more work (I think).
    Peter Mularien | Blog
    Author, Spring Security 3 (Book) - Packt Publishing, Available in print and eBook form
    SCJP 5, Oracle DBA
    Any postings are my own opinion, and should not be attributed to my employer or clients.


  4. #4
    Join Date
    Dec 2010
    Posts
    315

    Default

    How about considering bean profiles (available with Spring 3.1. M1) where you can have a bean for dev and another one for production. It might not fit exactly on what you really want but it may provide an alternative solution.

    See http://blog.springsource.com/2011/02...ucing-profile/

  5. #5
    Join Date
    Aug 2006
    Posts
    129

    Default ns

    i ran into this issue when i tried to use "method-security" enable=''${..}'',
    it would be great if we would be able to do so

Tags for this Thread

Posting Permissions

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