Results 1 to 2 of 2

Thread: sample code for domain object instance security interceptor?

  1. #1
    Join Date
    Nov 2004
    Posts
    18

    Default sample code for domain object instance security interceptor?

    The documentation has an example of how to use MethodSecurityInterceptor to secure business beans that are obtained from Spring context via ProxyFactoryBean.

    I would like to apply the same method-level security to the domain object instances returned from DAO layer (rather than obtained from Spring context as beans) and I don't see an example code for this.

    I assume that I'll have to write an interceptor that programmatically (rather than declaratively) creates a proxy for each domain instance that needs to be secured and return the proxy to the consumer that is going to subsequently access the properties of the domain object.

    I'm sure this is very common scenario, so is there any sample code for this that already exists?

    Thanks
    /Jong

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    You can approach this any other way you would with Spring. Acegi Security is essentially just an AOP Alliance MethodInterceptor, so if you can wire one of those, you'll be fine. People sometimes use prototype beans for this purpose.

    Alternatively, use the AspectJ integration which is a way of wiring instances with advices without needing to get them from the IoC container.

Similar Threads

  1. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  5. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM

Posting Permissions

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