Results 1 to 2 of 2

Thread: Factory that creates Acegi protected objects

  1. #1
    Join Date
    Aug 2004
    Posts
    2

    Default Factory that creates Acegi protected objects

    I have this sort of situation:

    interface Users {
    User getUserByID(String ID);
    }

    Anyone should be able to execute this method. The User object returned should however be protected by acegi.

    In my UsersImpl I can not just do "return new UserImpl(ID)", since I can not intercept this.

    I believe the correct path is to have something like this in UsersImpl:

    return applicationContext.getBean("UserFactory").createUs er(ID);

    I can then use ProxyFactoryBean to proxy the UserFactory interface, and add my Security definition as an interceptor.

    But, referring to applicationContext from a POJO implementation feels wrong.

    Can someone please get me on the right track?

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

    Default

    The Acegi Security reference manual has an "Access Control List" section which discusses the various approaches to this problem, and the respective advantages and disadvantages of each. If you have any further questions after reading this section, please feel free to ask.

Similar Threads

  1. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  2. Replies: 1
    Last Post: Jul 28th, 2005, 05:08 PM
  3. Question about bean factory usage
    By T in forum Container
    Replies: 6
    Last Post: Jul 1st, 2005, 01:04 PM
  4. Replies: 1
    Last Post: May 5th, 2005, 10:00 PM
  5. Remoting Factory Objects
    By ibbo in forum Remoting
    Replies: 0
    Last Post: Sep 20th, 2004, 08:17 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
  •