Results 1 to 4 of 4

Thread: how to get method and role relation from Bean

  1. #1
    Join Date
    Feb 2005
    Posts
    7

    Default how to get method and role relation from Bean

    like code in contact example:

    Code:
       <bean id="contactManagerSecurity" class="net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
          <property name="authenticationManager"><ref bean="authenticationManager"/></property>
          <property name="accessDecisionManager"><ref local="businessAccessDecisionManager"/></property>
          <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>
          <property name="objectDefinitionSource">
             <value>
    				sample.contact.ContactManager.create=ROLE_USER
    				sample.contact.ContactManager.getAllRecipients=ROLE_USER
    				sample.contact.ContactManager.getAll=ROLE_USER,AFTER_ACL_COLLECTION_READ
    				sample.contact.ContactManager.getById=ROLE_USER,AFTER_ACL_READ
    				sample.contact.ContactManager.delete=ACL_CONTACT_DELETE
    				sample.contact.ContactManager.deletePermission=ACL_CONTACT_ADMIN
    				sample.contact.ContactManager.addPermission=ACL_CONTACT_ADMIN
             </value>
          </property>
       </bean>
    My question is how to get method and role relation from Bean, not hand writie in config file。

    Code:
    sample.contact.ContactManager.getById=ROLE_USER,AFTER_ACL_READ
    thanks!

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

    Default Re: how to get method and role relation from Bean

    Quote Originally Posted by getdown
    My question is how to get method and role relation from Bean, not manuscript in config file
    Sorry, I don't understand the question.

    Could you elaborate, perhaps with an example of what you're trying to achieve?

  3. #3
    Join Date
    Feb 2005
    Posts
    7

    Default

    sorry perhaps i did not explain clearly:
    my question is
    is it feasible?:
    Code:
    <bean id="contactManagerSecurity" class="net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor"> 
          <property name="authenticationManager"><ref bean="authenticationManager"/></property> 
          <property name="accessDecisionManager"><ref local="businessAccessDecisionManager"/></property> 
          <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property> 
          <property name="objectDefinitionSource"> 
             <value> 
                 CollectionBean
             </value> 
          </property> 
       </bean>
    CollectionBean contain the values get from DB.

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

    Default

    Yes, you can implement your own ObjectDefinitionSource that obtains the information from anyway.

    Your application context would then look like this:

    Code:
    <bean id="myDatabaseObjectDefinitionSource" class="com.foobar.dbDefinitionSource"/>
    
    <bean id="contactManagerSecurity" class="net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
          <property name="authenticationManager"><ref bean="authenticationManager"/></property>
          <property name="accessDecisionManager"><ref local="businessAccessDecisionManager"/></property>
          <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>
          <property name="objectDefinitionSource"><ref bean="myDatabaseObjectDefinitionSource"/></property>
    </bean>

Similar Threads

  1. LDAPPasswordAuthenticationDao problem
    By benoit_m35 in forum Security
    Replies: 15
    Last Post: Jan 11th, 2006, 07:04 AM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Replies: 6
    Last Post: May 8th, 2005, 11:09 AM
  4. Replies: 1
    Last Post: Apr 13th, 2005, 10:08 PM
  5. Replies: 6
    Last Post: Feb 12th, 2005, 07:05 PM

Posting Permissions

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