Announcement Announcement Module
Collapse
No announcement yet.
how to get method and role relation from Bean Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Re: how to get method and role relation from Bean

    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?

    Comment


    • #3
      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.

      Comment


      • #4
        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>

        Comment

        Working...
        X